ZuKi|R Posted November 1, 2017 Posted November 1, 2017 Hello, they help me with this problem no as him aria but help need a hand, which is that I want to do is that each true time example each 1 minute repeat this funcion, but I do this and does not do it only repeats once. Already it try of some ways but only repeats once, some suggestion or an error that have ? ------------------- ---Off Element Data setTimer ( function() setElementData(bossDeady[ID][12],"boss",false)end,5000,1) setTimer ( function()removeElementData(bossDeady[ID][12],"boss.name") end,5000,1) setTimer ( function()removeElementData(bossDeady[ID][12],"health") end,5000,1) setTimer ( function()setElementAlpha(bossDeady[ID][12],4) end,5000,1) setTimer ( function() setPedOnFire(bossDeady[ID][12], true) end,5000,1) --- On Element Data setTimer ( function()setElementData(bossDeady[ID][12],"boss",true) end,9000,1) setTimer ( function()setElementAlpha(bossDeady[ID][12],255)end,9000,1) setTimer ( function()setElementData(bossDeady[ID][12],"boss.name",name) end,9000,1) setTimer ( function()setElementData(bossDeady[ID][12],"health",health)end,9000,1) setTimer ( function()setPedOnFire(bossDeady[ID][12], false)end,9000,1)
Storm-Hanma Posted November 2, 2017 Posted November 2, 2017 It will be helpful if u tell me what u looking for exactly ? Then only I can help Visit https://storm-hosting.xyz/ for free game servers !
ZuKi|R Posted November 2, 2017 Author Posted November 2, 2017 6 hours ago, Khadeer143 said: It will be helpful if u tell me what u looking for exactly ? Then only I can help what I want to do is that all this code is repeated every 1 minute.
Moderators IIYAMA Posted November 2, 2017 Moderators Posted November 2, 2017 (edited) function bossEffect1 (ID) ---Off Element Data if isElement(bossDeady[ID][12]) then setElementData(bossDeady[ID][12],"boss",false) removeElementData(bossDeady[ID][12],"boss.name") removeElementData(bossDeady[ID][12],"health") setElementAlpha(bossDeady[ID][12],4) setPedOnFire(bossDeady[ID][12], true) setTimer (bossEffect2, 4000, 1, ID) end end function bossEffect2 (ID) --- On Element Data if isElement(bossDeady[ID][12]) then setElementData(bossDeady[ID][12],"boss",true) setElementAlpha(bossDeady[ID][12],255) setElementData(bossDeady[ID][12],"boss.name",name) setElementData(bossDeady[ID][12],"health",health) setPedOnFire(bossDeady[ID][12], false) end end function executeBoss (ID) setTimer (bossEffect1, 5000, 1, ID) end executeBoss (ID) -- start the boss setTimer(executeBoss, 60000, 0, ID) -- start the boss over 60 seconds and infinity times = 0. Please mind the performance man, too much timers can cause a lot of lagg if not used correctly. Edited November 2, 2017 by IIYAMA Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
ZuKi|R Posted November 2, 2017 Author Posted November 2, 2017 1 hour ago, IIYAMA said: function bossEffect1 (ID) ---Off Element Data if isElement(bossDeady[ID][12]) then setElementData(bossDeady[ID][12],"boss",false) removeElementData(bossDeady[ID][12],"boss.name") removeElementData(bossDeady[ID][12],"health") setElementAlpha(bossDeady[ID][12],4) setPedOnFire(bossDeady[ID][12], true) setTimer (bossEffect2, 4000, 1, ID) end end function bossEffect2 (ID) --- On Element Data if isElement(bossDeady[ID][12]) then setElementData(bossDeady[ID][12],"boss",true) setElementAlpha(bossDeady[ID][12],255) setElementData(bossDeady[ID][12],"boss.name",name) setElementData(bossDeady[ID][12],"health",health) setPedOnFire(bossDeady[ID][12], false) end end function executeBoss (ID) setTimer (bossEffect1, 5000, 1, ID) end executeBoss (ID) -- start the boss setTimer(executeBoss, 60000, 0, ID) -- start the boss over 60 seconds and infinity times = 0. Please mind the performance man, too much timers can cause a lot of lagg if not used correctly. Oh, I see rightly, thank you very much and I understand what to use many SetTimer 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now