Ive been doing a game when you join, there is a 30 second timer and then the game starts. The timer is a screen gui. After 30 seconds, i wrote that it is going to destroy its self. After 30 seconds, it destroys its self like mentioned, the gui isnt in StarterGui anymore, but the timer stays on the screen even if it was deleted. After that an other gui is supposed to appear, but it doesnt appear for some reason. If you could help, I would appreciate it. Thanks
local StarterGui = game:GetService("StarterGui")
local CountdownGui = StarterGui.CountdownGui
local time = 30
for i = 1, 30 do
wait(1)
time = time - 1
script.Parent.Text = "Match starting in: "..tostring(time)
end
script.Parent.Text = "Starting Match..."
wait(1)
script.Parent.Text = "Choosing Teams..."
game.ServerScriptService.TeamChoosing.Enabled = true
wait(1)
CountdownGui:Destroy()
print("CountdownGui deleted from StarterGui")
local StarterGui = game:GetService("StarterGui")
local CountdownGui = StarterGui.CountdownGui
local time = 30
for i = 1, 30 do
wait(1)
time = time - 1
script.Parent.Text = "Match starting in: "..tostring(time)
end
script.Parent.Text = "Starting Match..."
wait(1)
script.Parent.Text = "Choosing Teams..."
game.ServerScriptService.TeamChoosing.Enabled = true
StarterGui.Teams.Enabled = true
wait(0.5)
CountdownGui:Destroy()
print("CountdownGui deleted from StarterGui")
--Appropriate reference
local CountdownGui = script.Parent.Parent
local time = 30
for i = 1, 30 do
wait(1)
time = time - 1
script.Parent.Text = "Match starting in: "..tostring(time)
end
script.Parent.Text = "Starting Match..."
wait(1)
script.Parent.Text = "Choosing Teams..."
game.ServerScriptService.TeamChoosing.Enabled = true
StarterGui.Teams.Enabled = true
wait(0.5)
CountdownGui:Destroy()
print("CountdownGui deleted from StarterGui")
You were referencing the Gui within StarterGui. That Gui never moves and is cloned into every Player’s PlayerGui.
If i put the script in a local script, i get this error now
TeamChoosing is not a valid member of ServerScriptService “ServerScriptService” - Client - LocalScript:16
So what do i do now to fix this. The i need that line, so i could enable the team choosing process. The script would get enabled and then you would be assigned to a random team. Is it possible to maybe put a RemoteEvent?