Hey guys, I hope you all do well! I’m making a countdown system, but for some reason, it goes faster by the “quantity” of the players in the server (2 Players = x2 times faster, 9 Players = x9 times faster).
I don’t want this to happen but for some reason it does.
I know there’s a lot of good people here, so I’ll be very grateful to you and your help if you can give me a hand with this, even if it’s a little one, thank you so much! Have a nice day!
I’m on a LocalScript and then I fire a RemoteEvent but in the “for i = x, y, z do end” there is no for i, v in pairs(), so I really don’t know what’s happening.
Here’s the script:
(I don’t know if it’s something about the LocalScript or the Value that Changes)
- LocalScript:
game.ReplicatedStorage:WaitForChild('ActivateRoundMoments').ActivateChoosingSystem.Changed:Connect(function()
local player = game.Players.LocalPlayer
local textLabel = player.PlayerGui:FindFirstChild('NightTest').RuleExplicationText
textLabel.Visible = true
local function typewrite (object, text, length)
for i = 1, #text,1 do
object.Text = string.sub(text,1, i)
wait (length)
end
end
textLabel.Visible = false
if textLabel.Visible == true then
textLabel.Visible = not textLabel.Visible
end
wait(1)
--Correctly place the Player Images and the Player Names on the UI--
game.ReplicatedStorage:WaitForChild('RemoteEvents').PlaceGuiLocations:FireServer(player)
--Correctly place the Player Images and the Player Names on the UI--
--Play the Music--
game.SoundService:WaitForChild('EnvironmentMusic').Music:Play()
-- Play the Music--
wait(3)
--Activate the countdown--
game.ReplicatedStorage:FindFirstChild('RemoteEvents').UpdateTimerGui:FireServer(player)
--Activate the countdown--
--Tween the BackgroundFrame down(With all the images of the players and their names to vote)--
game.ReplicatedStorage:WaitForChild('RemoteEvents').ShowSelectionUI:FireServer(player)
--Tween the BackgroundFrame down(With all the images of the players and their names to vote)--
end)
- ServerScript (The countdown “OnServerEvent”):
game.ReplicatedStorage:WaitForChild('RemoteEvents').UpdateTimerGui.OnServerEvent:Connect(function(player)
local Timer = game.ReplicatedStorage:WaitForChild('Timer')
Timer.Value = 45
for i = 0, 45, 1 do
wait(1)
Timer.Value = Timer.Value - 1
player:WaitForChild('PlayerGui').Timer.TitleFrame.SecondsLeft.Text = Timer.Value
end
end)