So i have multiple Gui buttons that navigate through the menu and i have MouseButton1Click's to do that. Then i have one that is supposed to give your a tool, however that one button doesnt even register its being clicked.
Heres my code for the tool button
local storage = game:GetService("ServerStorage")
local greatSword = storage.GreatSword:Clone()
function leftClick(plr)
print("equip")
greatSword.Parent = plr.Backpack
script.Parent.Visible = false
end
script.Parent.MouseButton1Click:Connect(leftClick)
And this is the code for the normal navigation buttons
script.Parent.Parent.Parent.Weapons.Visible = false
function leftClick()
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.Weapons.Visible = true
end
script.Parent.MouseButton1Click:Connect(leftClick)
The important bits are the functions, i am fairly new to roblox's language of scripting so it could be a simple mistake but i just cant figure out when they both are using the same function code but the tool button one just wont work while the other does.
Also they are buth under frames in the ScreenGui

2 comments
In LocalScript, you can't access the ServerStorage items. Try putting the tool in ReplicatedStorage or Lighting.
It still isnt doing anything, also i added a print("hello world") right at the very top of the script to see if the script was even running and it didnt show up in the output log, so it looks like that script isnt even running for some reason