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

Help needed for setting fire to part?

Asked by 8 years ago

I was following a tutorial from Roblox and ran into a problem when I was trying to run the script even though I've followed the instructions to point. Here's what I got:

function LightOnFire(part)
    print("Going to light this part on fire:")
    print(part.Name)

    fire = Instance.new("Fire")
    fire.Parent = part
end

firePart = game.Workspace.Lava
firePart.Touched:connect(LightOnFire)

Anyone got any idea what the problem is?

0
Is there anything showing up in the "Output"? NoahWillCode 370 — 8y
0
Nothing at all :/ HaloStorm22 10 — 8y
0
Not even the "Going to light this part on fire:" ? NoahWillCode 370 — 8y
0
Oh, I have found my problem; I had another function above it for the changing of day, so I removed it and it began to work. Why is that? HaloStorm22 10 — 8y
View all comments (4 more)
0
Was that function a while loop? NoahWillCode 370 — 8y
0
Yeah HaloStorm22 10 — 8y
1
Okay. Well, that's why. Scripts are read from top to bottom, left to right, by Lua. So if there's a while true do or any type of never-ending loop, Lua will never execute anything after the loop. Lua won't execute any code out of order ever. NoahWillCode 370 — 8y
0
Oh, I see since it's a loop Lua can never move on to the next line. Thanks alot HaloStorm22 10 — 8y

Answer this question