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: Can someone tell me why this doesn't work???

Previous Thread :: Next Thread 
blimp80 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
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