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

How can i make a proximityPrompt only visible when a certain player equips a tool?

Asked by 3 years ago

I am making a game in which there would be locked doors so some of the time you will have to break the doors with a battering ram, i am planning on if someone equips the battering ram (a tool), the proximityPrompt will be visible for the localplayer (the player with the equipped tool).

May anyone help me ?

1 answer

Log in to vote
0
Answered by
Rynappel 212 Moderation Voter
3 years ago

There is a property in ProximityPrompt called Enabled. You can make the prompt visible and invisible. And simple use a local script to detect when the tool is equipped, to make it visible.

local tool = -- enter path to tool here
local proximityPrompt = -- enter path to proximity prompt here
proximityPrompt.Enabled = false

tool.Equipped:Connect(function()
    proximityPrompt.Enabled = true
end)

tool.Unequipped:Connect(function()
    proximityPrompt.Enabled = false
end)
Ad

Answer this question