![]() |
Projectiles?
What kind of method or function should I look at to create a projectile that will do something to a player once it touches them?
I am really new to GS2, and I couldn't figure it out in GS1 either, so basic instruction would be best. for example, Player1 Shoots a projectile that moves in a straight line. Player 2 gets hit by it and says "Im hit!" Thanks in advance. |
For shooting a projectile, before calling shoot you need to set the parameters that will be recieved when the projectile lands:
PHP Code:
PHP Code:
PHP Code:
I don't think Clientside onActionProjectile is either accurate or synced with the serverside version of the function however, on Classic I use custom detection on the onActionProjectile2(x, y, params) event which occurs whenever a projectile hits anything and not just your player. |
Quote:
So if I call the onActionProjectile function, it affects the player that the projectile hits, not the player who shot it, correct? |
Quote:
|
Thanks for the updated post.
Also, there would only work on actual players and not NPCs, correct? Ah I might have to find people to test it on once I figure out what I want to do with it... D: |
The same works for NPCs yes, both Serverside and Clientside, although there is "onActionSProjectile" as opposed to "onActionProjectile" Serverside for projectiles that are shot via objects on the server rather than players.
These 2 functions are also recieved by the Control NPC for whenever a projectile lands anywhere on the server, except the first 2 parameters are the x and y coordinates of where it hit. |
| All times are GMT +2. The time now is 01:29 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.