my script is a script that goes in a textbutton and when you click on that button it pops up a gui.
heres my script:
1 | local shopgui = Workspace.ShopGui |
2 | local player = game.Players.LocalPlayer |
3 |
4 | script.Parent.MouseButton 1 Click:connect( function () |
5 | shopgui:Clone().Parent = player.PlayerGui |
6 | end ) |
Its not showing everything. I need help
Make sure this is in a local script.
1 | local shopgui = Workspace.ShopGui:Clone() |
2 | local player = game.Players.LocalPlayer |
3 | local playergui = player.PlayerGui |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | if playergui:FindFirstChild( "ShopGui" ) ~ = nil then --this makes sure you dont have duplicates |
6 | wait( 0 ) |
7 | else |
8 | shopgui.Parent = playergui |
9 | end ) |
without the if statement
1 | local shopgui = Workspace.ShopGui:Clone() |
2 | local player = game.Players.LocalPlayer |
3 | local playergui = player.PlayerGui |
4 | script.Parent.MouseButton 1 Click:Connect( function () |
5 | shopgui.Parent = playergui |
6 | end ) |