Advertisement
KashTheKingYT

Spawn Powerups

Nov 6th, 2021
1,205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. local powerup = game.ServerStorage.Powerup
  2. local timer = 7
  3. local y = 3.5
  4.  
  5. function spawnPowerup()
  6.     local rangeX = math.random(-60, 36)
  7.     local rangeZ = math.random(-137.5, -41.5)
  8.     local spawnedPowerup = powerup:Clone()
  9.     spawnedPowerup.Parent = game.Workspace
  10.     spawnedPowerup.Position = Vector3.new(rangeX, y, rangeZ)
  11. end
  12.  
  13. while true do
  14.     spawnPowerup()
  15.     wait(timer)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement