Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My GUI button does not make GUI's Visible. What happend?

Asked by
Zikelah 20
4 years ago

I have a GUI button that is supposed to make GUI's Visible, but instead makes the GUI's appear after you die. What happend with the script????

-- script:

local Police = game.Players.LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("Police")
local Prisoner = game.Players.LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("Prisoner")
local Citizen = game.Players.LocalPlayer:FindFirstChild("PlayerGui"):FindFirstChild("Citizen")

script.Parent.MouseButton1Click:Connect(function()
    Police.Visible = true
    Citizen.Visible = true
    Prisoner.Visible = true
end)


Can a user find the answer to my query?

2 answers

Log in to vote
0
Answered by
Mr_Unlucky 1085 Moderation Voter
4 years ago

Since this is a GUI, what you want to do is go to the properties of the ScreenGui, and then untick the box that says "ResetOnSpawn". This makes it so that it doesn't reappear once you respawn

Ad
Log in to vote
0
Answered by 4 years ago

The script has to be in a local script for any Gui to become visible.

Answer this question