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

Why do i get a error message even if the instance is valid?

I got a error message saying Shirt is not a valid member of Model.

I knew that the Instance were valid but lua just returns not valid.

player = game.Players.LocalPlayer
Model = Instance.new("Model",game.Workspace)
Humanoid = Instance.new("Humanoid",Model)
Shirt = player.Character.Shirt:Clone()
Shirt.Parent = Model
BodyColors = player.Character["Body Colors"]:Clone()
BodyColors.Parent = Model

I think lua is been silly.

1 answer

Lua is never silly you Did something wrong.

player = game.Players.LocalPlayer
Model = Instance.new("Model", game.Workspace)
Humanoid = Instance.new("Humanoid", game.Workspace.Model)
Shirt=Instance.new("Shirt", game.Workspace.Model)
Shirt.ShirtTemplate = 0 --  Add the shirt ID
Pants=Instance.new("Pants", game.Workspace.Model)
Pants.PantsTemplate = 0 -- Add the Pants ID
P = Instance.new("Part", game.Workspace.Model)
Model.Name = "Name it here"

here is a Corrected version of your script.

2 comments

0

I meant to get the shirt from the player into the model

0

That wont work...

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