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

Lava Script Fix (?)

Asked by 8 years ago

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?

0
Is there any error when you test this script? BlueTaslem 18071 — 8y
0
What is line six suppose to do? User#11440 120 — 8y
0
@wfvj014 Its spreads the fire in the player's body. @BlueTaslem nope. guyalf1 0 — 8y
0
FindFirstChild is a function, meaning you need : not ./// So change part.FindFirstChild on line six to part:FindFirstChild() User#11440 120 — 8y
View all comments (3 more)
0
@wfvj014 Okay, lemme replace the script, if it works, ill lock this script. guyalf1 0 — 8y
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") User#11440 120 — 8y
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 User#11440 120 — 8y

Answer this question