local Tool = script.Parent
local Gui= game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("MENU"):WaitForChild("Home")
Tool.Equipped:Connect(function()
Gui.Visible = true
end)
Tool.Unequipped:Connect(function()
Gui.Visible = false
end)
✓ ANSWER ACCEPTED
Local Script in tools not working after refresh. Any answers?
1 answer
✓ Accepted answer
Instead of accessing the gui from the LocalPlayer, try to access it like this:
local Tool = script.Parent
local Gui= game.StarterGui:WaitForChild("MENU"):WaitForChild("Home")
Tool.Equipped:Connect(function()
Gui.Visible = true
end)
Tool.Unequipped:Connect(function()
Gui.Visible = false
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
