of     1   

HydraRancher
#35613809Sunday, October 17, 2010 10:12 PM GMT

I was browsing through the free models and found this: voted = {2} function getVoted(name) if voted == {2} then return false end for i=2,#voted do if voted[i] == name then return true end end return false end function onChatted(msg, recipient, speaker) source = speaker.Name msg = string.lower(msg) if ((msg == "cleanup") or (msg == "clean up")) then if getVoted(source) == false then table.insert(voted, source) if #voted > (game.Players.NumPlayers * 0.7) then local bricks = game.Workspace:getChildren() for i=1,#bricks do if (bricks[i].Name == "Part") then bricks[i]:remove() end end voted = {2} end end end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered) Problems: 1) From what I can see, it deletes "Part". But the building blocks I used aren't "Part". Some are named smooth block model, or seat. How do I make it delete anything, without deleting scripts or groups? 2) It says "getChildren()" does this function look inside groups? Because, I've gathered when you copy something, it plops it straight into "Workplace", which is great, because I want the clean up script to wipe out anything inside work place, without damaging scripts or groups inside. Thanks.
madmonkeycat
#35614929Sunday, October 17, 2010 10:29 PM GMT

if (bricks[i].className == "Part") then
Legend26
#35615122Sunday, October 17, 2010 10:31 PM GMT

GetChildren() or the depreciated children() methods return a table of what is inside that object. This is only one of the many ways you can use it below. for i,v in next, workspace:GetChildren() do print(v.Name) end
HydraRancher
#35777570Thursday, October 21, 2010 7:13 PM GMT

Sorry for the late answer. I'm not sure what you're saying, my questions are, how can I modify this script so it'll remove ANY part (Seat, VehicleSeat, Part, Smooth Block Model) inside game.Workplace without deleting groups or scripts.
RAAAAAAH
#35779789Thursday, October 21, 2010 7:54 PM GMT

if bricks[i].className == "Part" or bricks[i].className == "WedgePart" or bricks[i].className == "VehicleSeat" or bricks[i].className == "Seat" then
HydraRancher
#35784172Thursday, October 21, 2010 9:05 PM GMT

Oh so I can just string together loads of different names? Thanks!
HydraRancher
#35784608Thursday, October 21, 2010 9:13 PM GMT

Oh. Actually, is there a faster method, since there's a lot of bricks? Or is this the only way to make sure I don't delete models?
HydraRancher
#35988681Monday, October 25, 2010 10:24 AM GMT

Bump.
HydraRancher
#36035330Tuesday, October 26, 2010 12:36 PM GMT

Bump. Put simply, how can I modify the script so it'll delete ANY model inside game.Workspace, but not anything inside a group, nor the group itself.
HydraRancher
#36120899Thursday, October 28, 2010 8:49 AM GMT

Bump. Really? Nothing?
HydraRancher
#36285597Sunday, October 31, 2010 1:02 PM GMT

Bump.
HydraRancher
#36359293Monday, November 01, 2010 10:00 PM GMT

Fifth Bump.
pivotmaster101
#36359540Monday, November 01, 2010 10:04 PM GMT

Let me try to understand you. You want it to delete the objects, but anything in the object, say a part inside a model, is not deleted?
HydraRancher
#38082455Saturday, December 04, 2010 2:12 PM GMT

Does this count as reviving? I didn't check the forums in a looong time. OT: Yes that is what I'm talking about. Anything in Workspace not in a group/model.

    of     1