I'm taking a simple minigame script and trying to make it less 2008ish with a few upgrades
I'm starting with changing the hint to a gui but for some reason the textlabel text won't change but I'm getting no errors and if I start a server in studio it'll change texts on the server screen but no on the players screen.
Here's my code:
minigames=game.ReplicatedStorage.Minigames:GetChildren()
h= game.StarterGui.Hint.TextLabel
while true do
if game.Players.NumPlayers>1 then
h.Text="Deciding what to play"
wait(3)
ranGame=math.random(1, #minigames)
gameChosen=minigames[ranGame]
h.Text="Minigame chosen: "..gameChosen.Name
wait(3)
gameChosenClone=gameChosen:Clone()
gameChosenClone.Parent=game.Workspace
wait(3)
--teleport
spawns=gameChosenClone.Spawns:GetChildren()
for i, v in pairs(game.Players:GetPlayers()) do
name=v.Name
check=game.Workspace:FindFirstChild(name)
if check then
checkHumanoid=check:FindFirstChild("Humanoid")
if checkHumanoid then
check:MoveTo(spawns[i].Position)
end
end
end
for i = 3, 1, -1 do
h.Text="Game begins in: "..i
wait(1)
end
--countdown
for i = 10, 1, -1 do
h.Text="Time left: "..i
wait(1)
end
h.Text="Game ended!"
wait(3)
gameChosenClone:Destroy()
else
h.Text="There needs to be more than 1 player to start"
end
wait(1)
end
