Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I'm Trying to make a grouped object dissapear on click, but its not working?

with a click detector but nothings working, all the scripts out there that i can find are for only a single block? The reason its not working is because its a bunch of parts grouped up but I don't know a script for that so can somebody please help?

4 comments

0

Could you elaborate a bit? Are you trying to delete them or just make them invisible and not collide with anything?

0

I'm just trying to make it go invisible for 1 minute then reappear. I'm doing this for a game where you click on something on the ground and it gives you coins but i will do that scripting myself.

0

is it a model

0

Its a model yes

1 answer

✓ Accepted answer

There is no Script needed, simply store the ClickDetector Instance as a child of the Model container, and it will activate for all descendants. The same principal applies for listening on to the signal for the Object activation:

local ClickDetector = script.Parent

local function DissolveObject()
    local Model = ClickDetector.Parent:GetChildren()
    for _,Object in pairs(Model) do
        if (Object ~= ClickDetector) then
            Object:Destroy()
        end
    end
end

ClickDetector.MouseClick:Connect(DissolveObject)

If this works for you, don't forget to accept this answer!

1 comment

0

Thankyou! that worked!

This discussion is preserved as it was. New answers, comments, and votes are closed.