If a player has a certain tool equipped, a proximity prompt is visible

I don’t know how I would do this. I have attempted to look for the tool in the player’s character when they have it equipped like so:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

if Player.Character:FindFirstChild("Camera") and Player.Character["Camera"]:IsA("Tool") then
	script.parent.ProximityPrompt.Enabled = true
end

However, it still doesn’t work and I don’t know what to do, any help? This is a local script in the block that has the proximityprompt. ^^

1 Like

Local scripts do not run in the workspace, you have to put it in StarterPlayerScripts or StarterGui.

Place this script inside of the tool

local Tool = script.Parent

Tool.Equipped:Connect(function()
  ProximityPrompt.Enabled = true
end)
Tool.Unequipped:Connect(function()
  ProximityPrompt.Enabled = false
end)

They still run if they are a descendant of the player’s own character and Tools when equipped

4 Likes

And for that to be the case, the script would either have to be in StarterCharacterScripts (forgot to add that) or inside of the tool. Here, he simply has it in a part outside of the tool

The P needs to be a capital.

Script.Parent

This still doesn’t work. It isn’t giving any errors either