So basically I've been trying to make a FireBody script which makes your body transparent and then you have the particle emitter on your torso and you move around and after about 5 seconds your body turns to normal... So this is what I scripted the problem I am having with it is that it makes the Head transparent and the rest of the body is not transparent and then when you spam the function it would make the torso transparent and then all of a sudden the whole body but the head would be transparent and it's confusing the heck outta me! I just don't even know what is going on at the moment.... Anyways here is the code:
player = game.Players.LocalPlayer
mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "q" then
local char = player.Character
local hum = char:WaitForChild("Humanoid")
hum.WalkSpeed = hum.WalkSpeed +90
local children = char:GetChildren()
for i = 1, #children do
wait()
for i,v in pairs(children) do
if v.ClassName == "Hat" then
v.Handle.Transparency = 1
elseif v:IsA("BasePart") then
v.Transparency = 1
for _, s in pairs(v:GetChildren()) do
if s:IsA("Decal") then
s.Transparency = 1
wait(5)
hum.WalkSpeed = hum.WalkSpeed -90
if v.ClassName == "Hat" then
v.Handle.Transparency = 0
elseif v:IsA("BasePart") then
v.Transparency = 0
for _, s in pairs(v:GetChildren()) do
if s:IsA("Decal") then
s.Transparency = 1
end
end
end
end
end
end
end
end
end
end)
Thank you, I hope you can tell me what is wrong here this is confusing me really!

1 comment
Thank you!