I tried making a script where a sphere is spawned every 3 seconds, but it doesn't work. Here is the code.
01 | function fire() |
02 | script.Parent.BrickColor = BrickColor.new( "Bright red" ) |
03 | bullet = Instance.new( "Part" , workspace) |
04 | bullet.CustomPhysicalProperties = true |
05 | bullet.Position = Vector 3. new(- 12.93 , 11.995 , - 191.363 ) |
06 | bullet.Shape = Enum.PartType.Ball |
07 | wait( 3 ) |
08 | bullet:Destroy() |
09 | end |
10 | fire() |
01 | function fire() |
02 | script.Parent.BrickColor = BrickColor.new( "Bright red" ) |
03 | bullet = Instance.new( "Part" , workspace) |
04 | bullet.CustomPhysicalProperties = true |
05 | bullet.Position = CFrame.new(- 12.93 , 11.995 , - 191.363 ) -- I think its better to use CFrame.new, if this doesn't work, try pls change back to Vector3 |
06 | bullet.Shape = Enum.PartType.Ball |
07 | wait( 3 ) |
08 | bullet:Destroy() |
09 | end |
10 |
11 | while true do -- since you say every 3 seconds, you need a "while" loop to work |
12 | wait() |
13 | fire() |
14 | end |
01 | function fire() -- function |
02 | while true do -- while loop |
03 | wait( 3 ) -- waits 3 seconds |
04 | local Part = Instance.new( "Part" ,game.Workspace) -- makes a new part |
05 | Part.Shape = Enum.PartType.Ball -- makes the Part a ball |
06 | -- if you want to destroy it every 3 seconds then put |
07 | -- Part:Destroy() |
08 |
09 | end |
10 | end |
11 | fire() |