local Tool = script.Parent
local Gui= game.Players.LocalPlayer.PlayerGui.MENU.Home
Tool.Equipped:connect(function()
Gui.Visible = true
end)
Tool.Unequipped:connect(function()
Gui.Visible = false
end)
Dev Console Output: https://prnt.sc/saicp1
local Tool = script.Parent
local Gui= game.Players.LocalPlayer.PlayerGui.MENU.Home
Tool.Equipped:connect(function()
Gui.Visible = true
end)
Tool.Unequipped:connect(function()
Gui.Visible = false
end)
Dev Console Output: https://prnt.sc/saicp1
The main issue is that your LocalScript loads before your GUI, which is breaking the script LocalScript. An :WaitForChild() will fix the issue. The second issue is that :connect is deprecated and you should use :Connect instead.
I assume you don't have a Handle for you tool. Go to your tool's properties and uncheck "RequiresHandle". If it is checked and your tool doesn't have a handle, the Equipped and Unequipped events won't fire.
local Tool = script.Parent
Tool.RequiresHandle = false
local Gui = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("MENU").Home
Tool.Equipped:Connect(function()
Gui.Visible = true
end)
Tool.Unequipped:Connect(function()
Gui.Visible = false
end)
probably an error of the gui not loading
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)
Still not working, but there's no output in the dev console anymore.
Try to add a remote event. Tell me later if it worked!
Local script, should it be a server script?
Doesn't work.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thanks, that was stupid of me.
Don't blame yourself. Everyone starts somewhere. Glad I could help.