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
9 years ago
1function lightOnFire()
2    print("Lighting on fire!")
3end

1 answer

Log in to vote
1
Answered by 9 years ago

I essentially answered this in your last post

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

Alternatively, you can write this:

1local function lightOnFire(touchedPart)
2    -- Do your thing.
3end
4 
5Part.Touched:connect(lightOnFire)
Ad

Answer this question