module.stopTimer() --Stops the timer
module.startTimer() – Starts after stoping the timer
module.setDownTimer(Time, speed) – change time to 1 or higher and speed to 0.1 or higher. and starts counting down.
module.setUpTimer(Time, speed) – change time to 0.1 or higher and speed to 0.1 or higher. and starts counting up.
The Timer Value is in the Module.
and a example how to activate the fumction:
local module = require(the location of the module)
module.stopTimer()
module.startTimer()
module.setDownTimer(Time, speed)
module.setUpTimer(Timer, speed)
Could you put this on GitHub or something so we can see the source? Also how does this work, does it use functions like os.clock or os.time, or do you use the while wait(1) do (code) method?
wdym post the source? It is a public module. You can just look at the script
(For anyone too lazy, here is the source code:)
--[[
-- Tutarial --
module.stopTimer() --Stops the timer
module.startTimer() -- Starts after stoping the timer
module.setDownTimer(Time, speed) -- change time to . or higher and speed to . or higher
module.setTimerUp(Timer, speed) -- change time to . or higher and speed to . or higher
-- End of Tutarial --
Made by baum
]]--
local Timer = Instance.new("IntValue")
local stopTimer = false
local module = {}
function module.stopTimer()
stopTimer = true
end
function module.startTimer()
stopTimer = false
end
function module.resetTimer()
Timer.Value = 0
end
local function stopDownTimer()
if Timer.Value == 0 then
module.stopTimer()
end
end
function module.setDownTimer(Time, speed)
Timer.Name = "Timer"
Timer.Parent = script
Timer.Value = Time
while wait(speed) do
if stopTimer == false then
Timer.Value = Timer.Value - 1
stopDownTimer()
end
end
end
function module.setUpTimer(Time, speed)
Timer.Name = "Timer"
Timer.Parent = script
Timer.Value = Time
while wait(speed) do
if stopTimer == false then
Timer.Value = Timer.Value + 1
end
end
end
return module