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

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

Asked by 10 years ago

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

Log in to vote
0
Answered by
IcyEvil 260 Moderation Voter
10 years ago

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.

0
I meant to get the shirt from the player into the model RobloxMinecraftDK 0 — 10y
0
That wont work... IcyEvil 260 — 10y
Ad

Answer this question