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

What am I doing wrong with this script?

Asked by 8 years ago
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?

0
Is this in a local or server script? JamesLWalker 297 — 8y
0
this is a local supercoolboy8804 114 — 8y
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. GoldenPhysics 474 — 8y
0
would you mind giving me a script explaining how to do this? supercoolboy8804 114 — 8y
View all comments (2 more)
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. Shawnyg 4330 — 8y
0
well im just learning........ supercoolboy8804 114 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago
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
Ad

Answer this question