Jump to content

Argument 2 got function Error in addEventHandler


Recommended Posts

Debugscript message: Bad argument @ 'addEventHandler' [Expected element at argument 2,got function]

What does "got function" mean?

I tried to  change getRootElement() with root, but I've got the same error.

 

function speedmeter ()
outputChatBox("test", source)
end
addEventHandler("onPlayerVehicleEnter", getRootElement(), speedmeter)
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...