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

Why Does my GUI keep on becoming Visible after respawning?

Asked by 4 years ago

So I'm very new to coding and I'm trying to make a game with some friends. I made a script so that when you click on an ImageButton it switches your team, and the GUI Visibility is set to false. It works, however when you reset or respawn ingame, the GUI becomes visible again, why is this?

Note :The GUI is set to visible = true in the beginning (as if it were the main menu)

local player = script.Parent.Parent.Parent.Parent.Parent


script.Parent.MouseButton1Click:connect(function()

player.Team = game.Teams.CounterTerrorist

script.Parent.Parent.Visible = false

script.Parent.Parent.Parent.BottomFrame.Visible = false

script.Parent.Parent.Parent.TextLabel.Visible = false

end)

0
Press disabled on the GUI, then it will only appear for the desired people. ghxstlvty 133 — 4y

1 answer

Log in to vote
0
Answered by
corbenv 17
4 years ago
Edited 4 years ago

Check if you have ResetOnSpawn still enabled in the properties for the ScreenGUI.

Example: https://imgur.com/a/9Y2zv79

I had this problem when I started too. Hope it solves the problem!

Ad

Answer this question