Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Whats the other way of a function?

I want to turn the scripts funtion below to something like: ex: script.Parent.Touched:connect(function() Something like that.

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.FirePart
 
firePart.Touched:connect(lightOnFire)
 
function putOutFire(part)
	print("Got to put out the fire on:")
	print(part.Name)
 
	fire = part:FindFirstChild("Fire")
	if fire then
		fire:Destroy()
	end
end
 
waterPart = game.Workspace.WaterPart
waterPart.Touched:connect(putOutFire)
 
firePart.Transparency = 1
waterPart.Transparency = 1

1 answer

✓ Accepted answer

I think you mean this?

Part.Touched:connect(function(touchedPart)
	print(touchedPart.Name)
end)

1 comment

0

Well has the funtion in the script I gave you been called?

This discussion is preserved as it was. New answers, comments, and votes are closed.