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

Having issues working with Tick?

Trying to work with the Tick() function but not working?

tick = 0  
while game.Workspace.Brick.Parent == Workspace do 
wait(1) 
tick = tick + tick() 
print(tick)
end

1 answer

✓ Accepted answer

You are overriding the function tick in your first line!

Use a different name for the current time!


You can see a similar thing here:

print(wait);
-- It's initial value:
-- function: 0x231b970
-- something!
wait = 1;
print(wait);
-- Value now:
-- 1
-- The function was lost!

tick, like any other name, is just a variable, so your assignments to tick are overwriting its useful initial value.

Also, tick() returns current time since a certain point. It is essentially never meaningful to increment a value by the current time as you are attempting in the snippet you posted.

This discussion is preserved as it was. New answers, comments, and votes are closed.