blimp80
|
  |
| Joined: 22 May 2011 |
| Total Posts: 278 |
|
|
| 15 Jul 2013 01:57 AM |
local t = {"RobloxTeam","Body Colors","Status","Animate","Shirt Graphic","CharacterMesh","Shirt","Pants"}
function added(crap) for i,v in pairs(t) do if (crap.Name == v) or (crap.className == v) then crap:Remove() end end end workspace.DescendantAdded:connect(added)
I went in to online mode and my character still had a shirt... |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 15 Jul 2013 02:00 AM |
1) Don't post scripts with curses, you'll get CD'd 2) You never called the function when the character spawns in 3) IIRC, Shirts/Pants don't remove their textures properly. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 15 Jul 2013 02:01 AM |
None of the items in 't' are a descendant of workspace, I think. It would only be your character's name, wouldn't it?
This is your script, fixed:
function added(crap) for i,v in pairs(t) do if (v.Name == crap[i]) or (v.className == crap[i]) then v:Remove() end end end workspace.DescendantAdded:connect(added)
Try this one if the above doesn't work:
function added(lol) for i, v in pairs(lol) do if v:findFirstChild(t) then v:remove() end end end workspace.DescendantAdded:connect(added)
Scripting Tutorials: youtube.com/user/smiley599roblox |
|
|
| Report Abuse |
|
|
blimp80
|
  |
| Joined: 22 May 2011 |
| Total Posts: 278 |
|
|
| 15 Jul 2013 02:02 AM |
Crap isn't a curse word, the script takes place when a descendant is added but you may be right about the textures. Thank you. |
|
|
| Report Abuse |
|
|
blimp80
|
  |
| Joined: 22 May 2011 |
| Total Posts: 278 |
|
|
| 15 Jul 2013 02:09 AM |
| @ Smiley, I tried both and neither worked but everything in workspace is a descendant of it so I had that part right. Idk what to do D: |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 15 Jul 2013 02:12 AM |
| Use FindFirstChild(name, true) until nil for best results? |
|
|
| Report Abuse |
|
|
Dueffy
|
  |
| Joined: 19 Oct 2011 |
| Total Posts: 58 |
|
|
| 15 Jul 2013 02:17 AM |
Well first of all its sloppy code I use global outputs makes it more efficient
|
|
|
| Report Abuse |
|
|
Dueffy
|
  |
| Joined: 19 Oct 2011 |
| Total Posts: 58 |
|
|
| 15 Jul 2013 02:17 AM |
| Oh and you dont call some1 when they spawn its lagged and it will do the command be4 the player loads |
|
|
| Report Abuse |
|
|
blimp80
|
  |
| Joined: 22 May 2011 |
| Total Posts: 278 |
|
|
| 15 Jul 2013 02:22 AM |
This is what the ouput reads from my script: Something unexpectedly tried to set the parent of Shirt to NULL while trying to set the parent of Shirt. Current parent is Player1. |
|
|
| Report Abuse |
|
|