Making a "Spawner" make butterfly's

文章正文
发布时间:2025-06-22 08:58

Next time, please try to show some sort of attempt to solve your problem. Also, don’t ask people to write entire systems for you. That said, I very quickly wrote a very basic script that can serve as a foundation.

local Spawners = workspace.Spawners local Butterfly = game.ReplicatedStorage.Butterfly local TweenService = game:GetService("TweenService") for _, spawner in pairs(Spawners:GetChildren()) do coroutine.wrap(function() -- each spawner acts independently -- spawn every 5-10 seconds while wait(5 + math.random(5)) do -- Clone butterfly into the spawner local fly = Butterfly:Clone() fly.Parent = workspace fly.Position = spawner.Position -- Tween the butterfly to a position local tween = TweenService:Create(fly, TweenInfo.new(math.random(20)), {Position = fly.Position + Vector3.new(math.random(30), math.random(30), math.random(30))}) tween:Play() -- Have another tween(s) here for the wings -- Despawn when tween is finished tween.Completed:Wait() fly:Destroy() end end)() end