![]() |
Spawn Point
like i said, i did gs1, so i still use if (playerdead).
can someone help? heres script. PHP Code:
|
Quote:
You should check for the event of when the player's dying. Like onPlayerDies(). Then you should trigger the server to set the level. Also, setlevel2's syntax is: setlevel2(level name as String, x as float, y as float); :P |
Also, you can't do...
PHP Code:
|
Ya...
PHP Code:
I suggest studying up on clientside/serverside as well as what are events, booleans and so on. |
PHP Code:
|
No it's not, again, the player has to have already been dead when the NPC is created.
|
function onCreated(){
if (player.hp <= 0 ) { setlevel2("hospital.nw",x,y); } } doesnt work |
Quote:
function onPlayerDies(){ //this is the gs2 way } |
PHP Code:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
I distinctively remember having to trigger to serverside when I scripted warp rings for an old project I was working on BEFORE the release of GS2. |
Quote:
Isn't onPlayerDies clientside only? If it is that won't work either becauset setlevel2() is serverside only. |
PHP Code:
|
Quote:
|
Quote:
On clientside, it triggers when the actual player dies. On serverside, it triggers when anybody dies :P It'll set the level but I doubt you want to go to the hospital when someone else dies. As I said, check for when the player dies, trigger to serverside and then set the level. |
if you're creating the script on a single level, that's fine. if you want to automatically warp the player to the hospital whenever he/she dies in any level, one way of doing this is by adding it to players as a weapon script, which is added to all players when they log in.
how i'd personally do this is incorporate it inside a weapon script file. basically what i have is a custom GUI and it handles 3 things: updating GUI, checking player's heart count and warp them to OSL if their heart count is 0 and display event warper when an event is going on. |
Examples in this thread have been horrendous.
Weapon: PHP Code:
And for a single level: PHP Code:
|
Quote:
I forgot to use //#CLIENTSIDE stuff xD Also I recently, like, 2 weeks ago found out setlevel2() was serverside :\ I R STOOPID. |
Quote:
although you could letup on the less advanced scripting peoples than yourself :p |
if (playerenters) {
toweapons -spawn; } if (playerdies){ sleep 0.1; setlevel2 levelname.nw,x,y; } that's what i use for re spawning but my world is offline and i don't have a npc server so it may not work for you |
Quote:
|
yes @ crow
|
Hah, I so knew it :p
|
Quote:
2) There's no distinct client/server side to this script. |
Quote:
|
Quote:
sorry |
Quote:
|
Quote:
Edit: No, he said his SERVER is offline and has no NPC Control. He said he USES it. |
Quote:
Quote:
Quote:
|
Quote:
|
Quote:
Offline world...no NPC-Server....sounds like a level editor world to me. Read his statement carefully, Switch. |
Quote:
|
| All times are GMT +2. The time now is 12:43 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.