I am making a script that starts a timer on a text label when the player clicks start(a surfaceGUI textButton). There is only one player per server.. What is wrong?
StartButton = game.Workspace.InstructionPart.SurfaceGui.TextButton
InstructionWall = StartButton.Parent.Parent
StringValue = game.ReplicatedStorage.timer
function StartRace()
InstructionWall.Transparency = 1
InstructionWall.CanCollide = false
InstructionWall.SurfaceGui.Enabled = false
wait(2)
InstructionWall.Transparency = 0
InstructionWall.CanCollide = true
InstructionWall.SurfaceGui.Enabled = true
for i = 1,100,1 do
wait(1)
StringValue.Value = i
for k, player in pairs(game.Players:GetPlayers()) do
local plrname = player.Name
game.Players.player.PlayerGui.ScreenGui.Timer.Text = i
print(player)
end
print(i)
end
end
StartButton.MouseButton1Click:Connect(StartRace)
tell me if I need to include more info!!!
