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

How do I make model disappear then reappear after a while?

How do I make a model disappear then re-appear after...lets say....5 seconds?

script.Parent.Touched:connect(function(t) -- Anonymous functions.
    for _, v in pairs(game:GetService("Workspace").Mod:GetChildren()) do
        v.Transparency = 1
    end
end)

1 answer

This one's pretty simple, really. First, we define the model in a variable.

model = script.Parent

Next, we make the function.

model = script.Parent

model.Touched:connect(function(t)

end)

Then, we make the model's parent "nil"

model = script.Parent

model.Touched:connect(function(t)
	model.Parent = nil
end)

Finally, we wait 5 seconds before having its parent be the workspace again.

model = script.Parent

model.Touched:connect(function(t)
	model.Parent = nil
	wait(5)
	model.Parent = game.Workspace
end)

It's as easy as that!

2 comments

0

This removes the model from the workspace. If you want it to just make the model invisible, do exactly what you did on line 2, but making the transparency 0. After waiting 5 seconds, of course.

0

When I put the script into the model it didnt work...

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