I'm trying to get Barrels to fall from a certain point every 1.5 seconds. I have the spawn point in for it and everything. When I click "Run", the barrel is in the sky where it should be falling from but it doesn't fall, and no more spawn in. How do i get it to spawn in every 1.5 seconds and fall down?
The script I have for it:
1.)Script.spawnObject = "" --entity "Spawn object"
2.)Script.spawnTime = 1.5 --float "Spawn time"
3.)local timer = 0
4.)
5.)function Script:UpdateWorld()
6.) timer = timer + (Time:GetSpeed()/100)
7.) if(timer > self.spawnTime) then
8.) local newObject = self.spawnObject:Instance()
9.) newObject:SetPosition(self.entity:GetPosition())
10.) timer = 0
11.) end
12.)
12.)end
Also, I do have the Barrel set as the spawn object for the spawning point, and the script is attached to it, as well.
Edit: I forgot to mention. I'm using Lua