Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

A button that will open a gui?

Im trying to create the following, when you press the button the shop gui will appear. I have been trying plenty of hours with different code

script.Parent.ClickDetector.MouseClick:connect(function(pl)
if pl.PlayerGui.Buyshop.Frame.Visible == false and pl.PlayerGui.colorgui.Frame.Visible == false and pl.PlayerGui.cook.Frame.Visible == false and pl.PlayerGui.Sellshop.Frame.Visible == false and pl.PlayerGui.awardlist.Frame.Visible == false then
pl.PlayerGui.Buyshop.Frame.Visible = true
pl.PlayerGui.Checkopen.Value = true

pl.PlayerGui.swoosh:Play()
repeat wait(.0000000001)
pl.PlayerGui.Buyshop.Frame.Position = pl.PlayerGui.Buyshop.Frame.Position + UDim2.new(0.2,0,0,0)
until pl.PlayerGui.Buyshop.Frame.Position == UDim2.new(0.4, 0,0.18, 0)
pl.Character:findFirstChild("Humanoid").WalkSpeed = 0
end
end)

Thank you, best regard ca40

2 answers

If this is in a server script, the server cannot access the PlayerGui, as it is empty for it.

The best way to get around this is to use remote events. Hope this helps!

This discussion is preserved as it was. New answers, comments, and votes are closed.