![]() |
Class help please.
Hi, im having issues with this script. I'm not really used to using triggeractions so I was wondering if anyone could help me figure out the issue as to why my triggeraction isn't actually being triggered. This code is in a Class. It seems fine as far as the button being called and checking for the player.x/y but when I try to do the trigger to serverside, it doesn't seem to trigger for some odd reason.
NPC Code:function onCreated() setshape(1, 32, 32); |
Try:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
but I didn't know about the scope issues, either. |
Quote:
The x/y/this.x/this.y is a problem on Gmaps though, dunno where he was testing it. |
Should use keydown(6) instead of hardcoded keys, while your at it. :)
Instead of keeping the last parameter blank, maybe include some sort of unique id to make sure that it receives the right trigger on the serverside, but it shouldn't be a problem, maybe if you have multiple drops stacked in one spot. Also setTimer(0.01) is too fast and un-needed since Graal operates @ 20 frames / second thus setTimer(0.05) is the shortest time you'll need. But I think you might of just typo'd and intended to use setTimer(0.1); ;) And.. instead of using a client variable in range, you should probably use a this. variable, then it won't have to update it with the server. Not to mention if you dropped multiple classes you'd pick them all up with one grab. :P |
I have another question, Inside of the class, I am trying to send variables from serverside to clientside in the class, Atm I'm trying to do so with a triggeraction also, but it doesn't seem to work. Any suggestions? :confused:
|
You can store values in this.attr[] values, like so.
For example purposes: PHP Code:
|
Yeah- I use the attribute feature alot to be honest. You can also use
HTML Code:
save[1-9] = value; |
You can use triggerAction() to communicate from clientside to serverside and from serverside to clientside in level/class npcs as well.
|
| All times are GMT +2. The time now is 06:15 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.