Forum > Scripts >

Timer Script | Lua module

Posts: 41

Threads: 17

Joined: Apr, 2018

Reputation: 0

Posted

This is a timer script.
Put your code at where it says "--put your code here"
-----------------------------------------
pcall(function()

local timer = 0;

game:GetService('RunService').RenderStepped:connect(function()

timer = timer + .02;


-- put your code here


end)

end)

------------------------------------------


An example could be:

pcall(function()

local timer = 0;

game:GetService('RunService').RenderStepped:connect(function()

timer = timer + .02;


if math.ceil(timer) == 5 then -- check if 5 seconds have passed

print('5 seconds have passed.') -- print to output that five seconds have passed

timer = 0; -- Reset timer.

end


end)

end)


  • 0

Posts: 401

Threads: 27

Joined: Jan, 2018

Reputation: 14

Replied

Oh wow thanks for contributing :D
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )