I only know this script:
***local Table = {roblox = "roblox", minecraft = "minecraft"}
for i,v in pairs(Table) do print(i,v) end***
i don't know why you would use something like this, but i know this is useful for timers:
for i = 5,0,-1 do print(i) wait(1) end
Please answer if you know
It's really useful if you want to do something to a select group of objects. Let's say you're creating a fighting game and you want every player in team red to be rewarded with a couple of coins when red wins and same goes for team blue.
Then you could create something like this to easily accomplish this.
function redWin() for i,v in pairs(game.Players:GetChildren()) do --main loop if v.Team == "red" then v.Coins = v.Coins + 50 --reward player end end end function blueWin() for i,v in pairs(game.Players:GetChildren()) do --main loop if v.Team == "blue" then v.Coins = v.Coins + 50 --reward player end end end