Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
Delete every child of 'Part' except for the clickdetector.
bump |
|
|
for i, v in pairs(game.Workspace.Part:GetChildren) do
if v:IsA("BasePart") then
v:Destroy()
end
end |
|
DraklesJoin Date: 2014-10-19 Post Count: 1066 |
local part = game.Workspace.Part;
for i,v in pairs(part:GetChildren()) do
if v.ClassName ~= "Click Detector" then
v:Destroy()
end
end
Life is short, so grip it and rip it. |
|
Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
thanks!
bump |
|
Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
Oh, it also deletes the clickdetector.
bump |
|
DraklesJoin Date: 2014-10-19 Post Count: 1066 |
It might be className rather than ClassName.
Life is short, so grip it and rip it. |
|
Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
It works fine in the first click, but in the second click, it deletes the clickdetector.
bump |
|
Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
Any ideas?
bump |
|
Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
bump |
|
|
local part = game.Workspace.Part;
for _,v in ipairs(part:GetChildren()) do
if not v:IsA("ClickDetector") then
v:Destroy()
end
end |
|
TimeTicksJoin Date: 2011-04-27 Post Count: 27115 |
script.Parent.ClickDetector.MouseClick:connect(function(player)
for i,v in next, script.Parent:GetChildren() do
if not v:IsA("ClickDetector") then
v:Destroy()
end
end
end)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
Gh0stistJoin Date: 2010-11-13 Post Count: 9513 |
Ok thanks, works now.
bump |
|