Simple Lava (Beginner Tutorial)

A simple way to make Lava that you can use in your game!

by NinjEagleEye

Author Avatar

This tutorial is a simple way to make Lava that you can use in your games and obbies. Let's start! First you need to create a part. You should make it a block it will be easier to shape into a floor.

image|100x100 This part will soon become your Lava block! Take this part and look at its properties. Go to appearance and change the color to a Lava like color (I used "Really Red").

image|100x100 After that go to "Material" and change it to "Neon". Now the part is really starting to look like lava! Next you should move and resize this part using the "Scale" and the "Move" buttons under the "Home" tab. After you make all the adjustments you want to the lava, you should start programming the Lava. Go to your part and rename it "Lava". Then add a script.

image|100x100 Now let's get to programming in Lua. This next picture is the code you need to type into your script canvas (make sure to delete the "print 'Hello world!'" phrase). This code has comments next to it explaining what everything is (example of a comment: "--> THIS IS A COMENT").

local lava = script.Parent --> This is a variable it defines Lava as the parent of this script. Variables are like names.

local function kill(otherPart) --> A function is like a command that you are giving, this funtion is going to kill whoever touches the lava.
	local partParent = otherPart.Parent --> This is a local variable, a local variable is a variable that only works in this function.
	local humanoid = partParent:FindFirstChild("Humanoid") --> This local variable is your Roblox character. It is called "Humanoid".
	if humanoid then --> This is a conditional statement. It determines if the "Humanoid" is touching the lava.
		humanoid.Health = 0 --> If the "Humanoid" is touching the lava this will set its health to 0, killing it.
	end --> End of the conditional statement.
end --> End of the function.

lava.Touched:Connect(kill) --> This is the command to run the function. If you do not type this then the game will know about the function, but will not
--> excute it.

Thank you for reading this tutorial I hope someone found it helpful! I spent lots of time on it! :)

View in-game to comment, award, and more!