I am currently having a problem where when i click a button it will not pop up the gui, please help:
1 | local sd = game.StarterGui.SchoolShopGUI.DirtSwordInfo |
2 |
3 | script.Parent.MouseButton 1 Click:Connect( function () |
4 | sd.Visible = true |
5 | end ) |
Try this.
1 | local plr = game.Players.LocalPlayer |
2 | local sd = plr.PlayerGui.SchoolShopGUI.DirtSwordInfo |
3 |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | sd.Visible = true |
6 | end ) |
Also, make sure this is a localscript.
I don't see an error in the script unless what you're trying to set visible to true to is not a frame or anything without the property of "Visible". Maybe add wait()
or WaitForChild
1 | local plr = game.Players.LocalPlayer |
2 | wait() |
3 | local sd = plr:WaitForChild( "PlayerGui" ):WaitForChild( "SchoolShopGUI" ).DirtSwordInfo |
4 |
5 | script.Parent.MouseButton 1 Click:Connect( function () |
6 | sd.Visible = true |
7 | end ) |