So… I am trying to make a running for _ seconds but it just happends to be only 2 seconds when i seconds passed… The Script…
local j = script.Parent.Configuration
j:SetAttribute("runCount",0)
while true do
wait(1)
local i = 1
i = i + 1
warn(i)
print(i)
j:SetAttribute("runCount",i)
script.Parent.Text = "RUNING FOR: "..j:GetAttribute("runCount").."secs"
end
local j = script.Parent.Configuration
j:SetAttribute("runCount", 0)
local i = 1
while true do
wait(1)
i = i + 1
warn(i)
print(i)
j:SetAttribute("runCount", i)
script.Parent.Text = "RUNNING FOR: " .. j:GetAttribute("runCount") .. " secs"
end
I’m not sure if that will solve your problem. Could you please elaborate on what you are trying to do?
Here is a better way of counting how long something happened in Roblox:
-- Set the start time of the timer
local startTime = tick()
-- Continuously update the timer and display the elapsed time
while true do
task.wait(1)
local elapsedTime = tick() - startTime
print("Elapsed time: " .. elapsedTime .. " seconds")
end