Hello.
I am trying to make this script I described above in the topic.
I wish to make a script that deletes the block I place in my game after a few seconds.
This model is called Grenade and it is placed in the workspace.
And this is the script I effortlessly tried to make it work:
local Part = Workspace.Grenade wait (5) Part:Destroy() Part.Parent = Workspace
Thank you.
Workspace
is deprecated, you're looking for workspace
. Use a ChildAdded
event to listen for a child being added.game.Workspace.ChildAdded:Connect(function(child) if child.Name == "Grenade" then wait(5) child:Destroy() end end)
local Part = Workspace.Grenade game:GetService("Debris"):AddItem(Part, 5)