this script starts a round of hide and go seek, i just want to change the text before the round starts, when the round starts and who the seeker is. but it stays label. here is my code:
local timer = 20
local recol = 0
---------------------------------------------
local screengui = game.StarterGui.ScreenGui
local texte = screengui.TextLabel
game.Players.PlayerAdded:Connect(function(plr)
recol = recol + 1
plr.Team = game.Teams.Spectator
print("Added 1")
end)
game.Players.PlayerRemoving:Connect(function(plr)
recol = recol - 1
print("Removed 1")
end)
task.spawn(function()
while task.wait(1) do
if recol >= 2 then
wait(5)
texte.Text = "Round Starting soon!"
task.wait(20)
texte.Text = "Round Started!"
local playerCharacters = {}
for _, character in pairs(workspace:GetChildren()) do
if game.Players:FindFirstChild(character.Name) then
table.insert(playerCharacters, character)
end
end
local Seek = playerCharacters[math.random(1, #playerCharacters)]
print(Seek)
texte.Text = `{Seek} is the seeker!`
local function MakeSeeker()
if recol >= 2 then
game.Players:GetPlayerFromCharacter(Seek).Team = game.Teams.Seeker
Seek.HumanoidRootPart.Position = Vector3.new(130.046, 5.5, 0.84)
end
end
if game.Players:GetPlayerFromCharacter(Seek).Team == game.Teams.Spectator then
MakeSeeker()
--Seek.Team = game.Teams.Seeker
elseif game.Players:GetPlayerFromCharacter(Seek).Team == game.Teams.Seeker then
print("this guy is murderer!")
return nil
end
for _,v in pairs(playerCharacters) do
if v.Name ~= Seek.Name then
if game.Players:GetPlayerFromCharacter(v).Team == game.Teams.Spectator then
print('aaaa')
game.Players:GetPlayerFromCharacter(v).Team = game.Teams.Hiders
end
end
end
wait(5)
for _,v in pairs(playerCharacters) do
game.Players:GetPlayerFromCharacter(v).Team = game.Teams.Spectator
texte.Text = "Round Over!"
end
end
end
end)
local timer = 20
local recol = 0
---------------------------------------------
game.Players.PlayerAdded:Connect(function(plr)
recol = recol + 1
plr.Team = game.Teams.Spectator
local texte = plr:WaitForChild("PlayerGui").ScreenGui.TextLabel
print("Added 1")
task.spawn(function()
while task.wait(1) do
if recol >= 2 then
wait(5)
texte.Text = "Round Starting soon!"
task.wait(20)
texte.Text = "Round Started!"
local playerCharacters = {}
for _, character in pairs(workspace:GetChildren()) do
if game.Players:FindFirstChild(character.Name) then
table.insert(playerCharacters, character)
end
end
local Seek = playerCharacters[math.random(1, #playerCharacters)]
print(Seek)
texte.Text = `{Seek} is the seeker!`
local function MakeSeeker()
if recol >= 2 then
game.Players:GetPlayerFromCharacter(Seek).Team = game.Teams.Seeker
Seek.HumanoidRootPart.Position = Vector3.new(130.046, 5.5, 0.84)
end
end
if game.Players:GetPlayerFromCharacter(Seek).Team == game.Teams.Spectator then
MakeSeeker()
--Seek.Team = game.Teams.Seeker
elseif game.Players:GetPlayerFromCharacter(Seek).Team == game.Teams.Seeker then
print("this guy is murderer!")
return nil
end
for _,v in pairs(playerCharacters) do
if v.Name ~= Seek.Name then
if game.Players:GetPlayerFromCharacter(v).Team == game.Teams.Spectator then
print('aaaa')
game.Players:GetPlayerFromCharacter(v).Team = game.Teams.Hiders
end
end
end
wait(5)
for _,v in pairs(playerCharacters) do
game.Players:GetPlayerFromCharacter(v).Team = game.Teams.Spectator
texte.Text = "Round Over!"
end
end
end
end)
end)
game.Players.PlayerRemoving:Connect(function(plr)
recol = recol - 1
print("Removed 1")
end)
local timer = 20
local recol = 0
---------------------------------------------
game.Players.PlayerAdded:Connect(function(plr)
recol = recol + 1
plr.Team = game.Teams.Spectator
local texte = plr:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("TextLabel")
print("Added 1")
task.spawn(function()
while task.wait(1) do
if recol >= 2 then
wait(5)
texte.Text = "Round Starting soon!"
task.wait(20)
texte.Text = "Round Started!"
local playerCharacters = {}
for _, character in pairs(workspace:GetChildren()) do
if game.Players:FindFirstChild(character.Name) then
table.insert(playerCharacters, character)
end
end
local Seek = playerCharacters[math.random(1, #playerCharacters)]
print(Seek)
texte.Text = `{Seek} is the seeker!`
local function MakeSeeker()
if recol >= 2 then
game.Players:GetPlayerFromCharacter(Seek).Team = game.Teams.Seeker
Seek.HumanoidRootPart.Position = Vector3.new(130.046, 5.5, 0.84)
end
end
if game.Players:GetPlayerFromCharacter(Seek).Team == game.Teams.Spectator then
MakeSeeker()
--Seek.Team = game.Teams.Seeker
elseif game.Players:GetPlayerFromCharacter(Seek).Team == game.Teams.Seeker then
print("this guy is murderer!")
return nil
end
for _,v in pairs(playerCharacters) do
if v.Name ~= Seek.Name then
if game.Players:GetPlayerFromCharacter(v).Team == game.Teams.Spectator then
print('aaaa')
game.Players:GetPlayerFromCharacter(v).Team = game.Teams.Hiders
end
end
end
wait(5)
for _,v in pairs(playerCharacters) do
game.Players:GetPlayerFromCharacter(v).Team = game.Teams.Spectator
texte.Text = "Round Over!"
end
end
end
end)
end)
game.Players.PlayerRemoving:Connect(function(plr)
recol = recol - 1
print("Removed 1")
end)
How about you create a String Value instead by using server to change the String value
On client when String value changed set your text to that String value