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

How do I turn this to a touched function?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago
function lightOnFire()
    print("Lighting on fire!")
end

1 answer

Log in to vote
1
Answered by 8 years ago

I essentially answered this in your last post

Part.Touched:connect(function(touchedPart)
    print(touchedPart.Name) -- This is what I wrote before.
    print("Lighting on fire!") -- This is what you wanted... Not very hard to change.
end)

Alternatively, you can write this:

local function lightOnFire(touchedPart)
    -- Do your thing.
end

Part.Touched:connect(lightOnFire)
Ad

Answer this question