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

Timed remove brick/model Script?

How Do I make it so its timed and will remove a brick or a model when players are only in game not on edit mode.

1 comment

0

Thanks :D

2 answers

wait(time_in_seconds)
object:remove()

1 comment

0

or perhaps I should use Destroy() since remove is now deprecated.

--Okay here's an example:

Brick = Instance.new("Part") -- Creates the brick Brick.Parent = Workspace -- Places it in the workspace Brick.Name = Brick --Names it Brick Brick.Size = Vector3.new(2,2,5) -- Makes it 2x2x5 Brick.CFrame = CFrame.new(0,5,0) -- Use CFrame in place of Position!!! Places it 5 spaces high

wait(10) -- waits 10 seconds

Brick:Destroy() --this removes the brick

--Another example: Place a brick into the workspace and name it brick, then make a script outside of the brick.

Brick = game.Workspace.Brick Wait(10) Brick:Destroy

-- or without a variable:

wait(10) game.Workspace.Brick:Destroy()

--Final example, insert a part and name it brick, then insert a regular script into it: Brick = script.Parent wait(10) Brick:Destroy()

--or without a variable:

wait(10) script.Parent:Destroy()

--A thumbs up would be much appreciated :PP

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