Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

2 comments

0

I think you need to play with .magnitude, but I don't "specialize" in range finding scripting enough to help.

0

Are you making a tool for handcuffs or your own custom welded equip thing?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.