How can i add Proximity Prompt to players?

1—When the players are near of other player , then a gui will appears
like:
E) to stole
You can reply this topic about of Proximity Prompt or a Gui

4 Likes

You could add a proximity prompt the player’s character, like so:

local newPrompt = Instance.new("ProximityPrompt") -- your prompt
newPrompt.Parent = plr.Character.UpperTorso
2 Likes

Can you write the script about of stoling players item when they click to the proximity

1 Like

And also is there any click detector script same as this algorithm?

1 Like

You could use the .Triggered event of the proximity prompt to do this, e.g

ProximityPrompt.Triggered:Connect(function()
    -- steal stuff
end)

I’m afraid I don’t know what you mean by this, could you elaborate?

Also, check out these other resources

2 Likes

I mean can we add click detector to the players
like this

local clickadd = Instance.new("ClickDetector")
clickadd.parent = plr.character.uppertorso
same as your script

2 Likes
local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player) -- connects to a function when a player joins, with a player variable
    local proxPrompt = Instance.new("ProximityPrompt")
    player.CharacterAdded:wait() -- waits for character to prevent "attempt to index nil with character" error
    proxPrompt.Parent = player.Character:WaitForChild("HumanoidRootPart") -- parents the proxprompt instance to humanoidrootpart
end)

proxPrompt.Triggered:Connect(function()
    -- do stuff here
end)
7 Likes

Whenever I do this, other players cannot see it.

1 Like

Make sure its in a script, not a localscript.

1 Like

There is a property of ProximityPrompt called “RequiresLineOfSight” try to disable that, then it will probably show.

3 Likes

Thanks man! This helped me out in the long run!

2 Likes