Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do i make this timer Gui repeat, and not reset when i die so everyone sees the same thing?

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

2 comments

0

try using InvokeClient. So when the client is invoked it starts counting down. Thing is exploiters can make it count down at any time

0

Okay, thanks

1 answer

✓ Accepted answer

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)

1 comment

0

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.