Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Timed remove brick/model Script?

Asked by 10 years ago

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.

0
Thanks :D mrnoobypoopy 5 — 10y

2 answers

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago
wait(time_in_seconds)
object:remove()
0
or perhaps I should use Destroy() since remove is now deprecated. 1waffle1 2908 — 10y
Ad
Log in to vote
0
Answered by
LevelKap 114
10 years ago

--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

Answer this question