![]() |
I've spent hours trying to figure this out......
HOW DO YOU GET HITPLAYER(ORWHATVER) TO HIT ANYONE WHO IS IN THAT SPOT?! |
-. .`
I'm gonna assume you want it to hit any player in a certain range around a point... NPC Code: basic pathagorean theorem for ya (a^2 + b^2 = C^2), or, in this case, (((a^2 + b^2)^.5) = c). Taking something to the power of .5 will find the square root, just in case you didn't know. this.fromx/this.fromy - This is where the player will be hit back from. If it's a weapon the player fires, I'd suggest using the player that fired it as this.fromx and this.fromy. You may have arrows or spells though that do different. Maybe even a monster ;) this.hitx/this.hity/this.hitradius - This is where you are checking for a player. It will check with the center at (this.hitx, this.hity), and check if a player's center is within this.hitradius. this.hitpower - how many halfhearts you want to take off the player. A hit power of 2 would take off 1 full heart. Now, if you wanted to check within a box... NPC Code: Only difference is that it checks within a box, and that box checks for the player's top left to be in that box. this.hitwidth and this.hitheight define how big the box is that it should check for a player within. Please excuse me if this isn't completely perfect, I don't really want to go testin' the scripts right now. |
| All times are GMT +2. The time now is 10:50 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.