Somehow this code makes my HumanoidRootPart blue (it's a sleep script), I can't figure it out. Help please:
local player = nil local f = ""
script.Parent.ChildAdded:connect(function() if (script.Parent:findFirstChild("SeatWeld")) then if (game.Players:GetPlayerFromCharacter(script.Parent.SeatWeld.Part1.Parent)) then player = game.Players:GetPlayerFromCharacter(script.Parent.SeatWeld.Part1.Parent) script.Parent.Parent.Name = "Zzz..." if (player.Character:findFirstChild("Shirt")) then local s = Instance.new("Shirt") s.ShirtTemplate= player.Character.Shirt.ShirtTemplate s.Parent = script.Parent.Parent end if (player.Character:findFirstChild("Pants")) then local p = Instance.new("Pants") p.PantsTemplate= player.Character.Pants.PantsTemplate p.Parent = script.Parent.Parent end for _,v in pairs(player.Character:GetChildren()) do if (v.className == "Part") then v.Transparency = 1 if (v.Name == "Torso") then script.Parent.Parent.Torso.roblox.Texture = v.roblox.Texture elseif (v.Name == "Head") then script.Parent.Parent.Head.face.Texture = v.face.Texture f = v.face.Texture v.face.Texture = "" end elseif (v.className == "Hat") then v.Handle.Transparency = 1 end end for _,v in pairs(script.Parent.Parent:GetChildren()) do if (v.className == "Part") then v.Transparency = 0 v.CanCollide = true end end end end end)
script.Parent.ChildRemoved:connect(function() if (player == nil) then return end if not (script.Parent:findFirstChild("SeatWeld")) then if (player.Character.Humanoid.Health == 0) then return end -- script.Parent.Parent.Name = "Figure" for _,v in pairs(script.Parent.Parent:GetChildren()) do if (v.className == "Part") then v.Transparency = 1 v.CanCollide = false if (v.Name == "Head") then v.face.Texture = "" elseif (v.Name == "Torso") then v.roblox.Texture = "" end elseif (v.className == "Shirt") or (v.className == "Pants") then v:remove() end end for _,v in pairs(player.Character:GetChildren()) do if (v.className == "Part") then v.Transparency = 0 if (v.Name == "Head") then v.face.Texture = f end elseif (v.className == "Hat") then v.Handle.Transparency = 0 end end end end)