Cannot hide proximityprompt for player holding tool

Whenever I try either:
The proximity prompt ends up not showing up for ANYONE
or the proximity prompt stays visible for everyone


local tool = script.Parent.Parent.Parent

local plr = tool.Parent.Parent

local localplr = Players.LocalPlayer

local prox = script.Parent

local function OnEquip()

if plr == localplr then

prox:Destroy()

end

end

tool.Equipped:Connect(OnEquip)```
1 Like

It looks like you’re using a localscript for this right?
Using Players.LocalPlayer would return the client.

local tool = script.Parent -- place the local script in the tool!
local plr = game.Players.LocalPlayer

local prox = workspace.--set this to be where the prox is located from workspace

local function OnEquip()
    prox.Enabled = false
end

local function OnUnequip()
    prox.Enabled = true
end

tool.Equipped:Connect(OnEquip)
tool.Unequipped:Connect(OnUnequip)
1 Like

not really what im trying to do
I’m trying to make the proximity prompt invisible only for the person holding the tool, everyone else can see it.

Yes, this is exactly what the script I gave you does. It has to be a LocalScript stored inside the tool.

1 Like

would this script not run for everyone in the game?
just because it’s in a tool doesn’t mean it wouldn’t run for everyone
but ill try it

What are you trying to achieve? I can’t see a clear goal of this code. Please be more descriptive.

1 Like

tried it, it did work guess I was just overthinking it.
Thanks