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

How do I make a gear light bricks on fire?

I've been working on this game and I got parts in Workspace to light other bricks on fire, but the script doesn't seem to work when it goes in a tool (a torch in this case). Any help available?


function lightOnFire(part)
	print("Going to light this part on fire:")
	print(part.Name)
 
	fire = Instance.new("Fire")
	fire.Parent = part
end
 
firePart = game.StarterPack.Torch.FirePart

firePart.Touched:connect(lightOnFire)

(Sorry if the code isn't showing up right, I'm still figuring this site out :P)

2 comments

0

For formatting: The ~~~ should be on their own line -- no text before after after them in that line. 

0

Thanks!

1 answer

Your script is using a part which is in StarterPack. When the player spawns, that tool will be cloned into the player's inventory, but the script will remain checking the part in StarterPack.

I'd recommend using a LocalScript inside the tool, and change "firePart" to:

local firePart = script.Parent.FirePart

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