
02-21-2011, 11:07 PM
|
|
Banned
|
Join Date: Jul 2004
Location: London
Posts: 2,029
|
|
|
It's much better to use the trigger function for this type of thing as opposed to public functions:
obj.trigger("Hit", param1);
As this would automatically be making the check as to whether the function "onHit" actually exists.
But yes you would need to do this both clientside (to make it appear instant to yourself), and serverside (for it to show to other players), for everyone else though this would be synced with your player, it's not a problem.
What I meant regarding the clientside objects is simply that the object on your client is not the same as the object on the server, for this type of thing to work you'd have to try something such as passing the name of the npc (if it was a local npc) or the coordinates of the npc to use with testnpcs(x, y);, which isn't really reliable. |
|
|
|