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

Parenting an Object to Body Part?

I am trying to parent fire to the player's left, but I don't know how. So far, I got this:

local pa = workspace:FindFirstChild("Left Arm")
if pa then
	local fire = Instance.new("Fire")
	fire.Parent = "Left Arm"
end

I am also trying to do it when the player hits the f key. How do I do that and how do I revise this code for the player's arm to be on fire?

1 answer

✓ Accepted answer

You're really close. Set the Parent property to your pa variable.

local pa = workspace:FindFirstChild("Left Arm")

if pa then
	local fire = Instance.new("Fire")
	fire.Parent = pa
end

You can look into UserInputService's InputBegan event to see how to do this upon hitting the 'f' key.

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