tool.Equipped:Connect(function()
if hasBook then
openGuiClone = script.Parent.openGui:Clone()
openGuiClone.Parent = game:GetService("Players").LocalPlayer.PlayerGui
openGuiClone.Enabled = true
isOpen = true
if isOpen then
openButton.MouseButton1Click:Connect(function()
weaponGuiClone = script.Parent.weaponGui:Clone()
weaponGuiClone.Parent = game:GetService("Players").LocalPlayer.PlayerGui
weaponGuiClone.Enabled = true
openGuiClone.Enabled = false
isOpen = false
end)
else
print("not working")
end
end
end)
when I equip my tool the first button appears, but when I click on it, it doesnât do anything. I tried printing right after the click and nothing.
Only reason I can think off is that maybe buttons donât work in starterpack?
It might as well be the most stupid mistake ever, I just canât seem to find it lol.
Gui must be in playerGui or in a Surface/Billboard Gui to work you must use a gui inside the playerGui , i recommend for more simplicity to put a script to activate the gui and handle other in the gui
What is the openButton assigned to? It may be the cause of your problem. Also, if you havenât already, please use print() more often for troubleshooting, especially around functions or if statements.
Youâre referencing the GUI in the Character when equipped, not the one in PlayerGui. Reference the one in the PlayerGui, as it will actually work. So after getting your openGuiClone variable, just put this below it:
openGuiClone = script.Parent.openGui:Clone()
local openButton = openGuiClone.open.Button
...