Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make a GUI appear every time you get close to a player?

Asked by 4 years ago

Hello, I'm trying to make a Handcuff Key bind System but first off I'm trying to figure out how to make the Key bind/GUI appear every time a player in a specific team gets close to another player. and if the GUI is visible and you press the key bind it print's something that I'll set in the output. Does anything have any forums that can relate to this?

0
I think you need to play with .magnitude, but I don't "specialize" in range finding scripting enough to help. asgm 109 — 4y
0
Are you making a tool for handcuffs or your own custom welded equip thing? 123nabilben123 499 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

In the client, you could create a loop that would keep iterating throughout each player and check the distance of each player by using magnitude. Then check if they are holding down the E key and you could make the frame visible

if Player:DistanceFromCharacter(OtherPlayersPosition) <= Distance and UserInputService:IsKeyDown(Enum.KeyCode.E) then
    Frame.Visible = true
end
Ad

Answer this question