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

Why isnt this LocalScript working?

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!

2 comments

0

Where is the localScript?

0

its in StarterGui,i wasnt really sure where to put it

1 answer

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

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