#Question
1 messages · Page 1 of 1 (latest)
Bro, you have ai LLMs for these kinds of queries
% means modus, and is used for mathematical calculations. x%y = x-(the largest number divisible by y and less than x) aka x%y = the rest after x/y in whole numbers. Lets look at an example: 7%3 =1 because 6 is divisible by 3 and the difference (7-6) is 1.
Metatables are a bit harder to explain. They’re used for making custom classes. Search ‘Metatables and OOP roblox studio' and watch a tutorial.
So because you can multiply 3 by 2 making 6, you cannot multiply it further because it would be more that x which is 7 and the difference between 6 and 7 is 1 so the answer is 1. I dont see what you use this with though.
Yes, that is correct. Its useful for all sorts of stuff, primarily checking if a number is whole (x%1 == 0) or even (x%2 == 0) but can also be used to format seconds like this:
local function formatSeconds(seconds)
local minutes = math.floor(seconds/60)
local secs = seconds%60
return minutes..":"..secs
end
print(formatSeconds(146)) --2:26
and so this can make time sensitive events ?
uhm im a little confused as to what this does sorry.
lets say you want a countdown GUI and you want it to wait 180 seconds. You would then probably use something like this to format the seconds into minutes:seconds like a digital clock.
ooooh okay i understand. Thank you for enlightening me. so in theory it can be used for time sensitive events, correct ? as you said this is a countdown so at the end something happens
Thx dude, explained well
I prefer asking these types of questions here, so other people could discuss the topic
Ai is boring af
Well, yes, but the % operator isn’t useful. You would just do it like this probably:
local minutes, seconds = 5, 0
local cd = minutes * 60 + seconds
while cd > 0 do
cd -= 1
task.wait(1)
end
print("Countdown over!")
Np
i see
** You are now Level 5! **
thank you Jamp