Question involving finding the location of player

So I’m trying to make it so that when someone presses an overlay button players within a couple meters of the player with the button gets damaged and a barrier appears from where the player hit the button.

1 Like

You could use a coordinate device

Welcome back @anon15775196. You probably would need to use a player coordinates device and a teleporter to teleport the player away from the activated barrier. I can make a guide but probably not today.

2 Likes

Also a damager because, you want damage

1 Like

Yea, you said it better than me

If that’s your name on your profile, you should probably change it, but I don’t think you have to

Can you show the settings for the coordinate device and the code?

Yeah I can

1 Like

You could add a relay, an overlay, and a damager. Change the relay to all other players, and you could change the amount of damage the damager deals. Wire the overlay and the relay, so that when the button is pressed, it triggers the relay. Then, wire the relay to the damager, so that when the relay is triggered, it activates the damager. Sorry I couldn’t get pictures for you, but I hope this helps!

No that wouldn’t work because the damage wouldn’t be within a couple meters and could end up anywhere.

You can use a player coordinate device with a trigger repeater that constantly checks if a player was close to another player. The trigger repeater will broadcast to a damager to damage the other player. The barrier part might be more difficult though.

1 Like

Can anyone provide any pictures for this?
Or like the actual settings of the devices?

Hey, I can help, I’m just a bit confused by your original explanation. What button are we damaging?

1 Like

Wait lemme rephrase my original explanation then.

So there’s this person with an overlay (let’s call them player A). When Player A presses the overlay, all players within a couple meters of Player A gets damaged and a barrier appears from where Player A used the overlay.

1 Like

Ah ok so the other players are getting damaged. Ok, that makes a lot more sense. I can get working on something I think will work, but might not. But real quick could you just tell me how many meters away they are supposed to be for the damage to work?

1 Like

Maybe like 15 meters.
Also I’m out of likes so take :heart: for now.

1 Like

Here we go!
First, have your game overlay button broadcast “buttonpressed” when the button is pressed.
Next, go into the blocks for the game overlay, and make this when receiving on button pressed:
image
Next, get a relay that receives on “buttonpropssaved”. Have it relay to All Other Players.
Then, wire it to a trigger, and make these blocks in the trigger:
image
Might look a little weird because I have external inputs. But I didn’t want to take 15 screenshots with internal outputs.
Now, just damage the player when receiving on “damageme”


As for the barrier part, I would just having zones across your map, because unless you had a barrier for each square, you couldn’t really tell without a lot of work which barrier to activate.

2 Likes

Thanks a lot!
You really are here to help!

Ok

2 Likes

Thanks! But real quick did you test it because I’m not fully sure if it works. It does in my mind but that has fooled me in the past.

2 Likes

One real quick question, do I need to make a new property for imagethe words in quotations?

@Bardy_2913 thanks!

1 Like

Yes, but not the channel one.

2 Likes