Lets say I had these parts in the workspace and I didn’t wanna have a script inside of everyone of them checking if they were touched I could just use a for loop for example:
for i,v in pairs(game.Workspace.Parts:GetChildren())do
if v:IsA('BasePart')then
v.Touched:Connnect(function(Player)
if game.Players:GetPlayerFromCharacter(Player.Parent)then
v.Transparency = 0
end
end)
end
end
If you play a game like Roblox piggy… and watch the guis of the npc and cutscenes, then you should see a little type writing effect. Which is quite helpful if you want to add detail and engage your players.
It’s useful for mathematical iterations or sequences that you want to iterate by a specific amount instead of using an epsilon for accuracy, such as a fibonnaci sphere or tilings.
im starting to understand! breakthroughs bro haha. i love scripting. so what whats a good example if you were getting information? i cant think of a good scenario
dude you can do -1 as increment and have the start be a high number then low number. thats cool. yo everone is being so helpful. thank you. so much value.
Yessir! A good starting point is make a game where if the player touches a brick, they start to fade away. Or you can do is you can put a bunch of parts in a folder, use a for i, v in pairs loop and have them fade away periodically. That’s a solid example.
oh that’s awesome. i’m starting to understand more. i’m going to write some scripts to better understand for loops. this already has been so helpful. i now understand a lot more.