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 » Scripting Helpers
Home Search
 

Re: Clothing Adder, Destroyer [HELP]

Previous Thread :: Next Thread 
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 12:43 AM
Shirt = "http://www.roblox.com/asset/?id=121347127"
Pants = "http://www.roblox.com/asset/?id=121347252"

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for a,b in pairs(character:GetChildren()) do
if b:IsA("Shirt") or b:IsA("Pants") or b:IsA("ShirtGraphic") then
b:Destroy()
end
end
local s = Instance.new("Shirt",character)
s.ShirtTemplate = Shirt
local p = Instance.new("Pants",character)
p.PantsTemplate = Pants
end)
end)

Not working, yet not showing any output.

Sterkte Empire Brigaider DHS
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 02:43 PM
bump

Sterkte Empire Brigaider DHS
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 03:05 PM
B2

Sterkte Empire Brigaider DHS
Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
14 Oct 2014 03:11 PM
make it wait until there is a shirt or pants, it may just iterate before they load.
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 03:16 PM
What about players that don't wear shirts or pants?
i.e noobs

Sterkte Empire Brigaider DHS
Report Abuse
Vyxium is not online. Vyxium
Joined: 31 Aug 2010
Total Posts: 1020
14 Oct 2014 03:20 PM
use waitforchild or findfirstchild
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
14 Oct 2014 03:23 PM
script.Parent:nil()

ur welcome
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 03:58 PM
Tried using FindFirstChild, that didn't work

Can't use WaitForChild, because that will wait until a shirt/pants/t-shirt exists, and what if they don't?

Sterkte Empire Brigaider DHS
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 04:13 PM
bump.....

Sterkte Empire Brigaider DHS
Report Abuse
Aesthetical is not online. Aesthetical
Joined: 01 Jan 2014
Total Posts: 2141
14 Oct 2014 04:14 PM
Use the ChildAdded event in a function.

Example:

character.ChildAdded:connect(function(child)
if child:IsA("Shirt") or child:IsA("Pants") or child:IsA("ShirtGraphic") then
child:Destroy()
end
end)
Report Abuse
Aesthetical is not online. Aesthetical
Joined: 01 Jan 2014
Total Posts: 2141
14 Oct 2014 04:17 PM
Also, you probably have to repeat Destroy() more than once. If you don't you'll get a message in the output about setting the short's parent to nil.

character.ChildAdded:connect(function(child)
if child:IsA("Shirt") or child:IsA("Pants") or child:IsA("ShirtGraphic") then
while child do
child:Destroy()
wait(.1)
end
end
end)
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 04:19 PM
@Aesth
Thanks! I'll try it out.

Sterkte Empire Brigaider DHS
Report Abuse
DarkheartSkillz is not online. DarkheartSkillz
Joined: 30 Sep 2011
Total Posts: 5125
14 Oct 2014 04:28 PM
Wouldn't destroy my t-shirt?

Sterkte Empire Brigaider DHS
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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