I need some help with a script that spawns a part at a location 10 times with a 5 second interval before each spawning. I have gotten the script to "know" what the part I am requesting to spawn is like and it's location, but I have yet to actually have the script successfully spawn it. I have studied some tools' scripts like the Time Bomb and the Rocket Launcher to see how they create the new object in the workplace, but they all use the player's location and the target of the mouse, while I need to use a static location. Basically, I need help with getting the script to make the part. Bear in mind I have 3 days of scripting experience.
Here is the script I have made so far:
-----beginning of script-----
function spawn()
local part = Instance.new ("Part")
part.BackSurface = 0
part.BottomSurface = 0
part.FrontSurface = 0
part.LeftSurface = 0
part.RightSurface = 0
part.TopSurface = 0
part.BrickColor = BrickColor.new(17)
part.FormFactor = 1
part.Size = Vector3.new (4, 1.2, 2)
part.Position = Vector3.new (0, 8, 0)
part.Name = "SpawnedPart"
part.Anchored = false
end
for spawncounter = 1, 10 do
wait (5)
spawn()
end
-----end of script----- |