Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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
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 Sergiomontani10 236 — 5y
0
Okay, thanks Derpedee 6 — 5y

1 answer

Log in to vote
0
Answered by
seith14 206 Moderation Voter
5 years ago
Edited 5 years ago

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)
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. skate992 57 — 5y
Ad

Answer this question