Hey, so i've decided to start learning lua to add it to my scope of knowledge and practice for object oriented programming for game design. I've only recently started and it seems i've been learning some new and outdated stuff at the same time.
It seems I've been learning how to reference R6 Character models with Head, Torso, LeftArm, RightArm, LeftLeg, and RightLeg in code under the character Parent.
Torso and Head still seem to work fine but I don't know if that's because I'm testing with the original character 6 limb model. You know? The blocky lego one. I've never changed it haha.
I created an explosion on click tool that sets limbs on fire by creating a new fire instance under the limb parent Head and Torso but it seems the others mentioned before come up as not part of the character Parent. Could they be located elsewhere or is there another way to reference them?
The point of the tool is to set the limb on fire for about 5 seconds (Which is taken care of by the tool to create, apply, and destroy the fire instance) and apply damage based on distance from explosion and limbs hit (which i have the distance calculation already in the tool and fire damage is applied through a separate PlayerScript that constantly checks for fire on each limb to apply a different damage accordingly.)
This works for the Torso and Head so far, but I can't seem to figure out the code reference for the arms and legs.
I found this, but it either doesn't answer my question, or I just don't understand it haha https://devforum.roblox.com/t/r15-default-package-ids/73050
Here is my check for fire code:
while true do
wait(.5)
local TorsoBurn = script.Parent.Parent.Character.Torso:FindFirstChild("Fire")
local HeadBurn = script.Parent.Parent.Character.Head:FindFirstChild("Fire")
if TorsoBurn ~= nil or HeadBurn ~= nil then
for i=1, 5 do
TorsoBurn = script.Parent.Parent.Character.Torso:FindFirstChild("Fire")
HeadBurn = script.Parent.Parent.Character.Head:FindFirstChild("Fire")
if TorsoBurn ~= nil or HeadBurn ~= nil then
if script.Parent.Parent.Character.Humanoid.Health > 0 then
script.Parent.Parent.Character.Humanoid:TakeDamage(10)
print(script.Parent.Parent.Character.Humanoid.Health)
wait(1)
end
else
break
end
end
TorsoBurn:Destroy()
HeadBurn:Destroy()
else
end
end
EDIT*
Forgot to mention, I added a print line of code into the tool to tell me what part is being hit and they do say Left arm, Right Arm, Left Leg, Right Leg. With the spaces as well. Not sure if that matters.
EDIT 2* So, I figure it out for my character.
script.Parent.Parent.Character:FindFirstChild("Left Arm")
this line of code works for my limbs I was originally using this:
script.Parent.Parent.Character.LeftArm
--or this
script.Parent.Parent.Character.Left_Arm
Would this work for any Character model?

2 comments
This helps a more than considerable amount! Thank you! I was always checking the Players folder and not the Workspace for the limbs. for some reason, it never occurred to me that the player parts would show up in Workspace... seems pretty obvious after having read that... HAHA
@ParanoidZombie approve his answer, please.