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

Trying to make parts anchor again after a set time, does this work?

Hi, I'm building a map, and I'm trying to make parts unanchor when an explosion hits them, and then anchor them after a set time.

I'm wondering if the following would work. If not, how do I make it work?

local explosion = Instance.new("Explosion",game.Workspace)

explosion.Hit:connect(function(hit)

    hit.Anchored = false
    wait(1)
    Anchored = true

1 answer

✓ Accepted answer

Hello,

Your script will work only if the explosion touches a part if it doesn't touch a part and it touches a model (for example your character) it would drop an error so the best is to check if 'hit' is a part if it's not don't don't run the function

For more information visit the wiki!

~Frag

2 comments

0

I'll take that as a yes, your script works

0

Uh, if it works then accept the answer.

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