Jump to content

Triggering clientside events won't work.


Dzakub

Recommended Posts

Hi,

I want to trigger a event from server by triggerClientEvent, but it doesn't work.

Here's the code:

  
Server: 
 function startTrip() 
    triggerClientEvent(source,"startTrip", source) 
end 
  
addEventHandler("onPlayerPickupHit", getRootElement(), startTrip) 
  
Client: 
addEvent("startTrip",true) 
addEventHandler("startTrip", getRootElement(), getTrip) 
  

Link to comment

No, you are wrong.

The source of this event is the player that hit the pickup.

And it is not the problem, my server shows an error that the event startTrip is not added clientside, However if i copy this same code to runcode (by run and crun) it works :shock:

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...