And now my towers simply wont dissapear with my destroy() and I don’t know why but for some reason putting it in a function makes it fail.
player = game.spawnPlayerXY("samurai", 40, 35)
player.maxSpeed = 17
player.maxHealth = 700
player.attackDamage = 20
ui.track(game,"time")
spawnTime = 2
killTime = 4
def randomTower():
if game.time >spawnTime:
spawnTime += 2
x = game.randomInteger(5,75)
y = game.randomInteger(5, 63)
fireTower = game.spawnXY("fire-spewer", x, y)
if game.time > killTime:
killTime += 2
fireTower.destroy()
while True:
randomTower()