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

Why isnt this LocalScript working?

Asked by 8 years ago

hello!

Ive being scripting a LocalScript to first destroy the LocalPlayer's shirts,pants and hats and then copy one from a model to the LocalPlayer but it dosent work!

heres the code :



local uselesshirt = game.Players.LocalPlayer.Character.Shirt uselesshirt:Destroy() local uselesspants = game.Players.LocalPlayer.Character.Pants uselesspants:Destory() local shirt = game.Workspace.swat_model_1.Shirt:Clone() shirt.Parent = game.Players.LocalPlayer.Character local pants = game.Workspace.swat_model_1.Pants:Clone() pants.Parent = game.Players.LocalPlayer.Character local uselesshats = game.StarterGui.Clothing.Player:GetChildren("Hat") uselesshats:Destroy() local helmet = game.Workspace.swat_model_1.helmet:Clone() helmet.Parent = game.Players.LocalPlayer.Character local vest = game.Workspace.swat_model_1.vest:Clone() vest.Parent = game.Players.LocalPlayer.Character

I couldn't figure what was wrong here,thanks!

0
Where is the localScript? ScriptsAhoy 202 — 8y
0
its in StarterGui,i wasnt really sure where to put it uranium_235 0 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

In Pants You Spelled Destroy Wrong!

local uselesshirt = game.Players.LocalPlayer.Character.Shirt

uselesshirt:Destroy()

local uselesspants = game.Players.LocalPlayer.Character.Pants

uselesspants:Destroy()



local shirt = game.Workspace.swat_model_1.Shirt:Clone()
shirt.Parent = game.Players.LocalPlayer.Character

local pants = game.Workspace.swat_model_1.Pants:Clone()
pants.Parent = game.Players.LocalPlayer.Character

local uselesshats = game.StarterGui.Clothing.Player:GetChildren("Hat")
uselesshats:Destroy()

local helmet = game.Workspace.swat_model_1.helmet:Clone()
helmet.Parent = game.Players.LocalPlayer.Character

local vest = game.Workspace.swat_model_1.vest:Clone()

vest.Parent = game.Players.LocalPlayer.Character

Ad

Answer this question