the script is
seconds = script.Parent.Parent.Second
script.Parent.Text = seconds.Value.." seconds"
for i = 1,seconds.Value do
wait(1)
seconds.Value = seconds.Value - 1
script.Parent.Text = seconds.Value.." seconds"
end
the script is
seconds = script.Parent.Parent.Second
script.Parent.Text = seconds.Value.." seconds"
for i = 1,seconds.Value do
wait(1)
seconds.Value = seconds.Value - 1
script.Parent.Text = seconds.Value.." seconds"
end
First thing I would do is put a RemoteEvent Inside ReplicatedStorage then I would make a Script and put it inside ServerScriptService Inside:
local rep = game:GetService('ReplicatedStorage')
local event = rep:FindFirstChild('RemoteEvent')
local seconds = 60 -- Amount Of Seconds
while true do
wait()
for i = 1,seconds do
wait(1)
seconds = seconds - 1
event:FireAllClients(seconds)
end
end
Now Create a LocalScript inside the text you want to change then put this inside:
local rep = game:GetService('ReplicatedStorage')
local event = rep:FindFirstChild('RemoteEvent')
event.OnClientEvent:connect(function (seconds)
script.Parent.Text = seconds.." seconds"
end)
On the Script line 05, you could just put "while wait() do". You don't need the other "wait()" on line 06 and it would still give you the same result.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
try using InvokeClient. So when the client is invoked it starts counting down. Thing is exploiters can make it count down at any time
Okay, thanks