Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I get this foor loop to work?

How can I get this to work?

local MoveUntil = 20
local Text = game.Workspace.Text

while true do
	if game.Players.NumPlayers > 0 then
		Text.Value = "The game is ready"
		wait(2)
		Text.Value = "The battle will begin in: "
		for i = 10, 1, -1 do
			wait(1)
		end
		Text.Value = "All fighters to the doors"
		wait(2)
		Text.Value = "The doors are now opening"
		wait(1)
		Text.Value = ""

		repeat 
    		for k, r in pairs(game.Workspace.InvisibleWalls:GetChildren()) do 
        		r.CFrame = r.CFrame+ Vector3.new(0,1,0)
    		end
    		wait(0.1)
		until game.Workspace.InvisibleWalls:GetChildren()[1].Position.Y >= MoveUntil

	else
 		Text.Value = "You need 2 players to begin"	
	end
	wait(1)
end

How can I get this to continously float up by 1 block?

1 comment

0

wait

1 answer

✓ Accepted answer
local MoveUntil = 20  -- For non-stop going up, set this to math.huge
repeat 
	for k, r in pairs(game.Workspace.InvisibleWalls:GetChildren()) do 
		r.CFrame = r.CFrame+ Vector3.new(0,1,0)
	end
	wait(0.1)
until game.Workspace.InvisibleWalls:GetChildren()[1].Position.Y >= MoveUntil

5 comments

0

that just moves the block up by 1, I want it to go up conintously, and also it moves the blocks to position 0,1,0, I want it relative, so all it does is just make the block float up

0

Oh, sorry, I shall edit it.

0

There, I fixed it it should move all the parts until it reaches the specified height.

0

It seem to work? whenever i go play solo, the game stops processing at 50% Ill send whole script

0

Does it give you an error, if so please tell me what it is.

This discussion is preserved as it was. New answers, comments, and votes are closed.