I have a script where it morphs the players shirt, and pants, but when they die, it disappear.
This is the script :
game.Workspace.ChildAdded:connect(function(player) local name = player.Name local playerinplayers = game.Players:FindFirstChild(player.Name) if playerinplayers ~= nil then playerinplayers.CanLoadCharacterAppearance = false player.Head.face.Texture = "rbxgameasset://Images/face1" player.Head.Transparency = 0 local bodycolors = Instance.new("BodyColors", player) bodycolors.TorsoColor = BrickColor.new("Pastel yellow") bodycolors.RightArmColor = BrickColor.new("Pastel yellow") bodycolors.LeftArmColor = BrickColor.new("Pastel yellow") bodycolors.HeadColor = BrickColor.new("Pastel yellow") bodycolors.LeftLegColor = BrickColor.new("Pastel yellow") bodycolors.RightLegColor = BrickColor.new("Pastel yellow") wait(2) local shirt = Instance.new("Shirt", player) shirt.ShirtTemplate = "rbxgameasset://Images/GokuShirt1" local pants = Instance.new("Pants", player) pants.PantsTemplate = "rbxgameasset://Images/GokuPants4" script.Disabled = true end end)
Instead of using workspace.ChildAdded
, use Player.CharacterAdded
.
http://wiki.roblox.com/index.php?title=API:Class/Player/CharacterAdded
You'll want to attach this event to each player upon joining:
game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(character) -- your code here -- the player's character model is now in the "character" variable end end