Nacidi
(ahren)
May 19, 2020, 3:56pm
1
Hello everyone,
While making a model that has a surface GUI with a text button, the scripts don’t work
here are the scripts and a photo of the explorer
https://gyazo.com/ffc9d1c33eae21d90866c5e1d2b4777a
https://gyazo.com/332603e1c19ad2e2f29fed6b09140bdd
script to open-
local frame = game.StarterGui.ScreenGui1.Frame
local fixButton = script.Parent
fixButton.MouseButton1Click:Connect(function()
frame.Visible = true
end)
2nd script, to close
local frame = game.StarterGui.ScreenGui1.Frame
local exitButton = game.StarterGui.ScreenGui1.Frame.Exit
exitButton.MouseButton1Click:Connect(function()
frame.Visible = false
end)
If you need more information, send me in the replies!
1 Like
Nacidi
(ahren)
May 19, 2020, 4:20pm
4
PlayerGui, i’m sorry, but where is that located?
I said use a relative path. PlayerGui is located inside a player (each player sees different things). When a player joins. everything from startgui is cloned into PlayerGui
Nacidi
(ahren)
May 19, 2020, 4:22pm
6
there is only one player in the game tho
I said use a relative path. as i said everything from starterGui gets cloned into PlayerGui and changing it won’t change it in the PlayerGui
The path is this:
local player = game.Players.LocalPlayer
player.PlayerGui.ScreenGui1.Frame
Nacidi
(ahren)
May 19, 2020, 4:28pm
9
yes, I remembered that, now I hope it works