Im trying to get fires to be added randomly to this building. I want a new fire to randomly spawn, and fires vanish after 4 seconds. Please explain how I could do this using simply methods, in only one main lua. Here is some sample code for how i plan to do it:
-- Create Timer
local messageTimer = Timer.new(4000)
-- Timer Function
function tick(event)
messageTimer:start()
AddFire = math.random(12)
flames[AddFire]:setVisible(true)
end
I want to use a timer, and every 4000 miliseconds ( 4 seconds) a flame is added or something)
thanks for the help!
Comments
Something like this should work:
And you can call this method based on how often you want to spawn fires, for example, every 5 seconds
Thanks for the help!
If you could help me get this working in simple, N00b terms and code it would be awesome, if its a more complicated problem, and I should learn a bit more before trying it, thats cool to.
thanks!
So what is your exact current problem?
You have a table of flames and you can spawn new fires like this for example
Likes: Mells
there are 9 windows, and I have it start of by spawning 3 fires in 3 random windows (the fires are a .mov so they are moving. Ideally, fires would randomly spawn to random windows, and each fire stays for 3 seconds and then dissapears. if it dissapears, I loose a point (for not putting it out) if i shoot it with the hose, i gain a point. If you have any questions regarding my logic, feel free to ask. Lets tackle this problem!
Thanks, iWatts
1. i have a text that says you put out blank / blank fires. where would I add one to each side of that? and second how do i change how quickly they spawn, and despawn/ thanks again!
How quickly they disappear depends on the number in Timer.delayedCall(4000, which is 4000ms or 4 seconds
1) I did not really understood your question
Likes: iWatts