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

Morph Script Help?

Asked by 9 years ago

well im making a Morph code, that when the player joins the game they look like a certain character, and the torso is supposed to be a random color. What's wrong with it?


game.Workspace.ChildAdded:connect(function(plr) local name = plr.Name local playerinplayers = game.Player:FindFirstChild(plr.Name) if playerinplayers ~= nil then playerinplayers.CanLoadCharacterAppearance = false plr.Head.face.Texture = "rbxassetid://24791658" local bodycolors = Instance.new("BodyColors", plr) bodycolors.RightArmColor = BrickColor.new("Pastel brown") bodycolors.LeftArmColor = BrickColor.new("Pastel brown") bodycolors.LeftLegColor = BrickColor.new("Dark stone grey") bodycolors.RightLegColor = BrickColor.new("Dark stone grey") bodycolors.TorseColor = BrickColor.Random() bodycolors.HeadColor = BrickColor.new("Pastel Brown") end
0
Why don't you change the Arms, Legs, ect. inside the Character, isn't of having the 'BodyColors' instance do it(, I don't use it, so I don't know it's purpose)? Also, you spelled 'Players' wrong on line 3. :) TheeDeathCaster 2368 — 9y

1 answer

Log in to vote
-1
Answered by
yoshi8080 445 Moderation Voter
9 years ago
game.Workspace.ChildAdded:connect(function(plr)
local name = plr.Name 
local playerinplayers = game.Players:FindFirstChild(plr.Name)
local asset = "rbxassetid://" -- asset link
if playerinplayers ~= nil then
    playerinplayers.CanLoadCharacterAppearance = false
    plr.Head.face.Texture = "rbxasset://63761658" -- changes face
    local bodycolors = Instance.new("BodyColors", plr)
    bodycolors.RightArmColor = BrickColor.new("Pastel Brown") -- changes player color
    bodycolors.LeftArmColor = BrickColor.new("Pastel Brown")
    bodycolors.LeftLegColor = BrickColor.new("Dark stone grey")
    bodycolors.RightLegColor = BrickColor.new("Dark stone grey")
    bodycolors.HeadColor = BrickColor.new("Pastel Brown")
    bodycolors.TorsoColor = BrickColor.new(math.random())
local shirt = Instance.new("Shirt", plr)
shirt.ShirtTemplate = asset.."0" set to shirt template id
local pants = Instance.new("Pants", plr)
pants.PantsTemplate = asset.."0" -- set to pants template id
end
end)

Here ya go it should be (math.random()) not .Random()

0
thx dracomaster153 15 — 9y
Ad

Answer this question