Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What am I doing wrong with this script?

local player = game.Players.LocalPlayer
local character = player.Character.CharacterAppearance


character.onPlayerEntered.CharacterAppearance:connect(function()
	character.CharacterAppearance = ("Shirt")
	character.CharacterAppearance.Shirt = ("shirtid")
	character.CharatcerApperance.Shirt.shirtid = ("http://roblox.com/asset/id?=232711648")
end)

character.onPlayerEntered.CharacterAppearance:connect(function()
	character.CharacterAppearance = ("Pants")
	character.CharacterAppearance.Pants = ("pantsid")
	character.CharacterAppearance.Pants.pantsid = ("http://roblox.com/asset/id?=233364124")
end)

I'm trying to make a Character Appearance script for my game to change a character's appearance when entered. But this doesn't work. What did I type wrong?

6 comments

0

Is this in a local or server script?

0

this is a local

0

onPlayerEntered isn't a valid event name. You want game.Players.PlayerAdded. Plus, if you can get the LocalPlayer (meaning if it's a local script), then you don't need the events at all.

0

would you mind giving me a script explaining how to do this?

0

Oh boy. You've attempted to create your own version of Lua. You need to read up on the Wiki, as this isn't proper scripting.

0

well im just learning........

1 answer

✓ Accepted answer
local Player = Game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()

local NewShirt = Instance.new("Shirt") -- Create a shirt. Players won't spawn with one (because you should have AutoCharacterAppearance turned off)

local NewPants = Instance.new("Pants") -- Create new pants for the same reason

NewShirt.ShirtTemplate = "rbxassetid://232711647" -- Original ID was wrong. You must use the texture.
NewPants.PantsTemplate = "rbxassetid://233364123"

NewShirt.Parent = Character -- Obviously, parent the clothing to the character
NewPants.Parent = Character

This discussion is preserved as it was. New answers, comments, and votes are closed.