i want to know how to make a item spawner every so long Ex: star drops ever 180 seconds and despawns 50 seconds later
COMMUNITY QUESTION
How to make a Object Spawner?
1 answer
You can achieve this by using Debris and Instance.new() or cloning it and wrapping it inside a while loop.
local star = game:GetService('ServerStorage').Star -- location of star.
--Cloning item:
while wait(180) do
local clone = star:Clone()
clone.Parent = workspace
-- Despawning:
game.Debris:AddItem(clone, 50)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
