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

ResetOnSpawn Not Working For What Reason?

Asked by 6 years ago

So, I'm trying to turn off ResetOnSpawn, I tried to do this aswell.

game.StarterGui.TeamChangeGui.ResetOnSpawn = false

So far, everything I've tried, Hasn't Worked. Can Anyone Help Me Out On This Please? Thank You.

0
So you want the GUI to not show up once the player re-spawns? VeryDarkDev 47 — 6y

2 answers

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

Hello, kingbooker48!

Use this script:

game.Players.PlayerAdded:Connect(function(plr)
    while not game.Players:FindFirstChild(plr.Name) do wait() end
    script.ScreenGui.Parent = game.Players[plr.Name].PlayerGui
end)

ATTENTION: Script must have a child called "ScreenGui" (The gui that will be shown on first join)

Good Luck with your games!

Ad
Log in to vote
0
Answered by 6 years ago

Scripts only run when the game starts, and if your gui is in the starter gui, it will automatically give any users in the game the gui, which means you have to reference the players playergui and get from there.

game.Players[""].PlayerGui:WaitForChild("TeamChangeGui").ResetOnSpawn = false

There there is no point in "script" doing it, as if your not making the gui from script, You can simply just press ResetOnSpawn and make it false in the properties of the gui. In which case you are script making the gui, you would have to use this code instead:

<varible>.ResetOnSpawn = false
0
@HeComesAt_Night I tried to change the properties, Didn't Work. kingbooker48 25 — 6y

Answer this question