RB-004
Roblox rising lava script
Lava that slowly climbs, kills on touch, then drops back down to start again.
- Script type
- Script
- Where it goes
- Inside the lava Part
- Category
- Hazards and pads
For your own game in Roblox Studio. Not for use in other people's games.
The code
-- Rising lava: the part climbs, kills on touch, then resets and repeats.
local START_DELAY = 10 -- seconds before the lava starts to rise
local RISE_HEIGHT = 60 -- studs to rise
local RISE_TIME = 90 -- seconds to rise that far
local PAUSE_AT_TOP = 5 -- seconds to wait at the top
local RESET_DELAY = 5 -- seconds to wait after dropping back down
local TweenService = game:GetService("TweenService")
local lava = script.Parent
lava.Anchored = true
local startPosition = lava.Position
local endPosition = startPosition + Vector3.new(0, RISE_HEIGHT, 0)
-- Kill anything with a Humanoid that touches the lava.
lava.Touched:Connect(function(hit)
local humanoid = hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid.Health = 0
end
end)
local riseTween = TweenService:Create(
lava,
TweenInfo.new(RISE_TIME, Enum.EasingStyle.Linear),
{ Position = endPosition }
)
while true do
lava.Position = startPosition
task.wait(START_DELAY)
riseTween:Play()
riseTween.Completed:Wait()
task.wait(PAUSE_AT_TOP)
lava.Position = startPosition
task.wait(RESET_DELAY)
endHow to set it up
- Insert a large flat Part below your map. Colour it orange and set the Material to Neon.
- Put your map so the lava can rise past it.
- Add a Script inside the lava Part and paste the code.
- Play. After 10 seconds the lava starts to rise.
Change it
- A short RISE_TIME makes it harder. 90 seconds for 60 studs is fairly gentle.
- Make the lava part big enough that players cannot walk around the edge.
- Players who respawn will spawn at your SpawnLocation. Keep it above the lava start height.
More in Hazards and pads
More Roblox tools
- Shirt and pants templatesFree Roblox clothing templates to download: hoodies, jerseys, jeans, joggers and more.
- Robux tax calculatorWork out what you receive after the marketplace fee, or what to charge.
- Robux to USD calculatorConvert earned Robux to dollars at a DevEx rate you can edit.
- Shirt and pants template makerColour each panel of the 585×559 clothing template and download it.
- Username generatorGenerate usernames that fit the 3–20 character rule.