Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you Add Fire and BodyColor Changing to this Script?

Asked by
SirPaco 66
9 years ago

I would like all of the Parts of the Humanoid (Head, Torso, Left Arm, Right Arm, Left Leg, Right Leg) to set on Fire and for the BodyColor to change to Black.

I created a Script that kills any Humanoid when they touch the Part but I do not know how to set the Player on Fire and turn all of their BodyColors to the color of Black.

script.Parent.Touched:connect(function(hit)
    if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.Health = 0
    end
end)

2 answers

Log in to vote
0
Answered by
neoG457 315 Moderation Voter
9 years ago
script.Parent.Touched:connect(function(hit)
    if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.Health = 0

for a,b in pairs(hit.Parent:GetChildren()) do 
if b:IsA("Part") then

b.BrickColor = BrickColor.new("Black")
burn = Instance.new("Fire")

fire.Parent = b

hit.Parent.Shirt:Destroy()
hit.Parent.Pants:Destroy()
end
    end)

Tell me if it doesnt work.

0
It works but it the body parts actually have to touch the Part in order for it to set on Fire and to turn to Black. I want it so that all of the Parts do that. Also, is it possible to remove all of the Humanoid's clothing as well or no? SirPaco 66 — 9y
Ad
Log in to vote
0
Answered by 9 years ago
script.Parent.Touched:connect(function(hit)
    if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.Humanoid.Health = 0
for i,v in pairs(hit.Parent:GetChildren()) do 
if v.ClassName == "Part"
then
v.BrickColor = "Black"
fire = Instance.new("Fire")
fire.Parent = v
end
end
    end
end)

0
Sorry, but it did not work. Thank you anyway. SirPaco 66 — 9y
0
error? User#5978 25 — 9y

Answer this question