Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Local Script in tools not working after refresh. Any answers?

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)

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.