Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make a moving block (lava) for my game?

Asked by 7 years ago

I wanna make a game called "The Floor is Lava" on Roblox but i dont know how to make a moving block script. Ex: There should be an Intermission. When you join or when the game will start. When the game start it will says "The Floor will be Lava in 10 seconds" then after the countdown. The Lava will start to move. Unfortunately I dont know how to script a moving block. Can You Help me?

1 answer

Log in to vote
0
Answered by 7 years ago

Yes, I can help you. There are multiple ways of moving a Part. (CFrames, BodyMovers, TweenService, etc.) I find the most reliable of these to be CFrames.

For your instance, I would use something simple. like this:

--This script is placed inside the "Lava" Part
local lava = script.Parent
local speedmove = 0.05 --how far per step the lava should move

wait(10) --10 seconds before the round starts

for i = 1, 200 do --keep the 1, but change the 200 to how many times you want the lava to move
    lava.CFrame = lava.CFrame + Vector3.new(0, speedmove, 0) --Moves the lava UP by speedmove 200 times
    wait(0.1) --time in between steps
end

Did this help?

Ad

Answer this question