generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Custom clothes script isn't working...

Previous Thread :: Next Thread 
Xucs is not online. Xucs
Joined: 23 Jul 2010
Total Posts: 11844
19 May 2015 11:10 PM
local char = game.Players.LocalPlayer.Character
local c = char:GetChildren()
for i=1,#c do
if c[i]:IsA("Shirt") or c[i]:IsA("Pants") then
c[i]:Destroy()
end
end
Instance.new("Pants",char).PantsTemplate = "http://www.roblox.com/Asset?id=248980267"
Instance.new("Shirt",char).ShirtTemplate = "http://www.roblox.com/Asset?id=249917190"

Nothing happens :/



Leveraged/tixmaker101 + 55k posts |
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
19 May 2015 11:17 PM
local P = game.Players.LocalPlayer
local C = P.Character or P.CharacterAdded:wait()

for _,_ in pairs (Character:GetChildren()) do if _:IsA'Shirt' or _:IsA'Pants' then _:Destroy() end end

Instance.new('Pants', C).PantsTemplate = 'rbxassetid://248980267'
Instance.new('Shirt', C).ShirtTemplate = 'rbxassetid://249917190'
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
19 May 2015 11:17 PM
replace char with this

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
19 May 2015 11:17 PM
@mycheeze

you can't name variables _ and refer back to them
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
19 May 2015 11:18 PM
o & the other problem wiff dis c0de is, once the character is added, it still has to load hats & such, so I would suggest you use a descendant added function on the character model and then disconnect the function after a certain amount of time has expired.

Because if you left that function running, it would destroy your newly inserted shirts/pants
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
19 May 2015 11:19 PM
@Crow, yiss u kan

local _ = 'ye'

print(_)
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
19 May 2015 11:51 PM
o rly?

but y r u naming 2 varis the same noob
Report Abuse
mycheeze is not online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
19 May 2015 11:54 PM
When I use that in a table, the first variable is equal to which position it is in the table, and the second being the value.

But since both are the same name, it is over-written by the second value

Similar to if you did this

local A = 1
A = 2

print(A)

>2
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image