"return;" Command (or similar) in Lua?
Asked by
4 years ago Edited 4 years ago
Hello fellow devs! I have a fairly simple question this fine, fine evening.
I know in JavaScript, you can use the
command to restart a for loop, etc.
I was wondering how I could do that with Lua.
My Code (The issue):
2 | if (Part:IsA( "Part" )) = = false or Part.Name = = "Solid" then |
3 | print ( "Removed" .. Part.Name) |
Full code:
01 | local Model = script.Parent |
05 | for Model, Part in pairs (Model:GetChildren()) do |
08 | if (Part:IsA( "Part" )) = = false or Part.Name = = "Solid" then |
09 | print ( "Removed" .. Part.Name) |
13 | if Part.Shape = = Enum.PartType.Block then |
14 | game.Workspace.Terrain:FillBlock(Part.CFrame, Part.Size, Enum.Material.Mud) |
15 | elseif Part.Shape = = Enum.PartType.Cylinder then |
17 | elseif Part.Shape = = Enum.PartType.Ball then |
18 | game.Workspace.Terrain:FillBall(Part.Position, Part.Size.X/ 2 , Enum.Material.Air) |
I'm either looking for another scriptinghelpers/DevForum link or an example.
Thanks in advance,
Tim