![]() |
Small Script Help! Can't get Statue working
Hey,
bin trying to script for the past days, my gold gonna expire in 1 day so i gotta find a quick way to fix it up... so what shall I do? It used to work but I messed and added the /reset command, not working anymore :/ Thanks Quote:
|
- Didn't even use 'temp.pl' in defining the NPC's looks (example: temp.pl.head)
- Mixing GS1 and GS2 - Nesting another function inside of 'onCreated' for no apparent reason - What exactly are you trying to do? |
Quote:
-I get that alot -I'll try -making it once clicked, the attributes will load as the player's |
Are you using this online or offline? If you're using it online I'll help you with a GS2 version.
|
Quote:
|
PHP Code:
|
PHP Code:
PHP Code:
PHP Code:
Yah no clue what I wrote there so ask me if you didnt understand something Damn Emera was faster but anyway it might help |
Wouldn't you want to be saving them in serverr. variables instead of client variables so they don't change for each player?
|
Quote:
EDIT for John: To have it viewable for everyone you could simply change the client.statue_first to server.statue_first. That should work aswell and would be viewable for everyone. But probably I'd change it to something serverside than and use serverr.flags since they are more secure and not changeable with memory editors. |
Quote:
Edit : oh nvm got it fixed! |
If you save statue settings to serverr flags, Skyld will cleanse your server with flame. Server flags are not appropriate for statues at all... What if 1000 statues were added? >: (
If statues absolutely NEED to keep their outfit even when the level is updated/server is restarted, use files. e.g. this.statuename = "myhouse_statue1" and then when the outfit is set serverside, save all the variables into a file e.g. statues/myhouse_states1.txt In the oncreated event, check if the file exists and if it does, load the values from it. Keep it all serverside and then the server won't have to sync Statue outfits for statues in every single damn level with the player :) |
Quote:
|
Since its a scripting thread, I need help with the variable commands, for example the ec system, I wanted to make it add on each time I want.
Quote:
Quote:
|
Quote:
But, you should take it to the OGCC and not here at this point. |
Quote:
PHP Code:
I doubt you'll be able to understand how to load/save from text files this early on in learning GS2, so here's an example of how to save and load your NPC's configuration to/from a text file. Firstly, you'll have to give your NPC-Server the following right. HTML Code:
rw objects/statues/*.txt PHP Code:
|
Okay Thanks Emera...
am currently working on an Event, but is there a way to find (in the level) the guy with the most ... lets say clientr.ec anyway I can warp him and find the command? like is there something like player.most.clientr.ec.setlevel2? |
Use for (temp.pl : players) { to scan through all of the players in the level. You can then use temp.pl.clientr.ec to check their ec clientr flag.
|
Quote:
something like for (winner: playerwithmostclientr.ec) { isnt there something like this similar? like I will use winner.setlevel2() if it worked etc.. |
You could do something like this:
PHP Code:
|
Quote:
|
Quote:
|
You can call it however you want to. You can also call it temp.stefan, temp.john, ... . On Graal it's mostly called temp.pl for one player and temp.plyrs/temp.plys for more players. It's just easier for others to see what you want to do with it. Kinda like organisation but there are no rules for that.
The 2nd "param", in this case players, is always an array. In this case players is an array, just like allplayers, serveroptions.staff, ... . You could also do something like PHP Code:
PHP Code:
I just prefer the for() loop in this case |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
Quote:
|
Quote:
|
Quote:
Quote:
And second : is there any other way without using this.number? Thanks a lot! P.S @iPad : his script style is readable and nice to the eye. |
Quote:
Nothing big mango, just pointing it out ;) Quote:
Here's some links to help get you started: http://forums.graalonline.com/forums...ad.php?t=61805 http://fp4.ca/gs2beautifier/ Also, I don't get what you're trying to say about this.number and temp.number. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
cool story bro
|
-_-
-_- hmm |
because you are supposed to restart everything and you still dont seem to get the if-statements (maybe you did already, didnt check your thread yet)
|
Quote:
|
y u bump?!!?
|
All times are GMT. The time now is 01:14 PM. |
Powered by vBulletin/Copyright ©2000 - 2025, vBulletin Solutions Inc.