Hi guys! So I’ve decided to do my first SWEP, and it’s going alright. It’s a Mine Turtle, and it does everything it should. You say “Hello Mine Turtle” when you throw it, then it requires you to be a certain distance away from it before it clicks and arms itself, then when a player gets near to it, it says “Hello” and blows up!
It’s supposed to be a simple SWEP but it’s proving difficult to get the proximity code to work properly in the way I want it to. So far it works on a radius base like such:
if distance < (self.Range) then playersnear = playersnear + 1
It’s basic and it works for now. What I want it to do however is to take into account any walls obstructing the player, because a player can walk up to the other side of the wall to the mine and it’ll blow up still. Does anybody have any idea how to do this? Any help is appreciated, thank you.
Oh, and if you want any more codes from the addon to aid in your help then just let me know what you need and I’ll put it up for you.