So, I was watching a tutorial on youtube about “tick ()” and there was a moment when the script looked like this:
local gameStart = tick()
script.Parent.Parent.Part.Touched:Connect(function()
print(tick() - gameStart)
end)
On the line “print(tick() - gameStart)”,
I understood what the “-” was for in this case, however, I didn’t find anything to say about it, is there a page on the wikia that explains the use of this better?
I’ve been watching and haven’t found anything about “-”
I think I understand what I was thinking, I’m not talking about " " but about the hyphen
The - is simply subtraction, you can find a list of math operators here: Operators | Documentation - Roblox Creator Hub
The given code in your original post would be subtracting the game time from the current time, in turn finding the amount of time elapsed.
1 Like
L_luma
(Lluma)
June 15, 2020, 3:42pm
#6
" - " is the subtraction operator. tick() returns a number.
I already realized it has to do with math, I understand thanks.