So, I am trying to make a server create system. I am trying to make a GUI button that if you click, makes another GUI. When I have the script and press the button it makes the GUI (I can see in explorer) but I am not able to see the frame.
My Script:
`local Tutorial = Instance.new("Frame") local OpenFrame = Instance.new("TextLabel")
script.Parent.MouseButton1Click:Connect(function(click)
Tutorial.Name = "Tutorial" Tutorial.Parent = game.StarterGui.ScreenGui.Data Tutorial.BackgroundColor3 = Color3.fromRGB(170, 0, 0) print('Made frame')
end)`
Thanks.
local Tutorial = Instance.new("Frame") local OpenFrame = Instance.new("TextLabel") script.Parent.MouseButton1Click:Connect(function(click) Tutorial.Name = "Tutorial" Tutorial.Parent = click:WaitForChild("PlayerGui") Tutorial.BackgroundColor3 = Color3.fromRGB(170, 0, 0) print('Made frame') end)
NOTE: Use this as a LocalScript.
A lot of people having problems on GUIS not opening, but now, instead of StarterGui, use PlayerGui
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") -- access for PlayerGui, since you need to use LocalPlayer, use a LocalScript! local Tutorial = Instance.new("Frame") local OpenFrame = Instance.new("TextLabel") script.Parent = game:GetService("StarterPlayer").StarterPlayerScripts script.Parent.MouseButton1Click:Connect(function(click) Tutorial.Name = "Tutorial" Tutorial.Parent = PlayerGui.ScreenGui.Data Tutorial.BackgroundColor3 = Color3.fromRGB(170, 0, 0) print('Made frame') -- since there is no function or any statements, end) is not needed!
I hope this works, thanks for reading!