Jump to content

setTimer help


Asmgol

Recommended Posts

hello guys 

why when i use setTimer (  getArmour, 1000, 1, source)

script not working

Noticeable 

when i use

 addEventHandler("onPlayerDamage",getRootElement(),getArmour)

the script working fine 

please help me, sorry for bad english

Link to comment
  • Moderators

I think the first problem is, the source is not definied before setTimer.

The second problem, you need to trigger the getArmour event, because this function using source and not the function's first argument.

 

Somethink like that:

playerElement = getPlayerFromName("Asmgol")
setTimer(function()
    triggerEvent("getArmour", playerElement)
end, 1000, 1)

 

Edited by stPatrick
Link to comment
On 06/03/2019 at 14:42, stPatrick said:

I think the first problem is, the source is not definied before setTimer.

The second problem, you need to trigger the getArmour event, because this function using source and not the function's first argument.

 

Somethink like that:


playerElement = getPlayerFromName("Asmgol")
setTimer(function()
    triggerEvent("getArmour", playerElement)
end, 1000, 1)

 

i did like you told me but its still not working

can any scripter gave my his discord or anything like that and ill gave him the full function of my script to fix it for me please?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...