![]() |
Warp Player and Max Heart Problem
2 Questions:
1) How do you warp a player in a while (visible) {if (mousedown) {WARP PLAYER} } (Thats not the full code but thats how its done, sorta. Setlevel2 isnt working. But it works in a simple if (playerchats&&strequeals(#c,)) {} script. 2) I got a server, how do I make it so that people start off with 5 hearts instead of 3? |
Quote:
Quote:
|
Quote:
Quote:
Quote:
|
Quote:
|
Okay well look heres my code:
NPC Code: Works offline, not online. |
AAahh dont use while loops for something like that. Use a timeout instead.
Why are there multiple instances of //#CLIENTSIDE? |
Quote:
Quote:
|
setlevel2 must be serverside.
|
Okay! I got it down to a simple:
NPC Code:// NPC made by ZicklePop Whats wrong with it? |
that's a completely terrible script
I will tell you why first of all, you are doing a 0.1 second loop serverside, which is the worst idea ever if you can at all avoid it you are comparing strings wrong NPC Code: that is the kind of format you must use in GScript third you are doing your loop using while and sleep, that's a horrible idea use timeout for loops fourth, this kind of thing should be integrated into whatever system you have for picking the gender in the first place good luck with improving your scripting abilities, we all have to start from somewhere |
NPC Code: For the love of Govannon, don't use 'while'. Your mouse stuff is clientside. Your setlevel stuff is serverside. Practice using triggeraction to call serverside stuff for warping. |
Quote:
Quote:
|
But doesnt it have to be in its own NPC because of Serverside and Clientside?
|
NPC Code: Thats my current code, but it only works on update level (or level refresh wahtever you call it) |
where is client.statsgender being set?
that's where you should be calling the level switch (as a side note: client. flags are insecure and are able to be edited clientside by malicious players using certain programs) |
Quote:
|
First off, make it easy for people to read.
Second off... Do not put statements without commands. Third... If you have a string that contains differant possibility, use "else if" Fourth... Be lazy, It helps. Fifth... Why the sleep? Basically, I would've done it like this: PHP Code:
Hrm... Perhaps this violates the Forum Rule "Do not ask full scripts". Ohwell, it was quite short regardless. |
no clientside part is needed if it is triggered on playerenters
you realize this would be the same thing? but better PHP Code:
|
Thanks you too, I think I've a got it!
|
If this is just for setting the gender of a player why not use
setgender male/female; and check if(playerismale) or if(playerisfemale) (with else you'd only need to use one anyways) I'm not sure if that is stored clientside or serverside but unless gender is important I thought that'd be okay. Unless setgender is a depreciated command now o.o |
I always thought it was deprecated, myself
I'm pretty sure Era uses it, though |
Quote:
|
| All times are GMT +2. The time now is 04:45 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.