Hello,

I am making a alien apocalypse game and theres a scene that needs lava. I made lava with spreading fire. This is the script -

function LavaKill(part)
	local Human = part.Parent:FindFirstChild("Humanoid")
	if Human then
		Human:TakeDamage(100)
	end
	local HumanPart = part.FindFirstChild("Part")
	if HumanPart then
		SpreadFire = Instance.new(Fire)
		SpreadFire.Parent = HumanPart
		
		
	end
end

Lava = game.Workspace.Lava
Lava.Touched:connect(LavaKill)

The problem is that the lava doesnt spread any fire to the player body. How i can fix it?

7 comments

0

Is there any error when you test this script?

0

What is line six suppose to do?

0

@wfvj014 Its spreads the fire in the player's body. @BlueTaslem nope.

0

FindFirstChild is a function, meaning you need : not ./// So change part.FindFirstChild on line six to part:FindFirstChild()

0

@wfvj014 Okay, lemme replace the script, if it works, ill lock this script.

0

Also, when doing Instances you're suppose to put the thing you're trying to make, in your case Fire, in a string. So change Instance.new(Fire) to Instance.new("Fire")

0

Ugh... Also, you should use WaitForChild on line 15. You might already know this, but you're not checking if the part the lava touched is the player after line five. That's all I see. #AnswersInComments