Jump to content

Where problems tostring ?


-ffn-python

Recommended Posts

I Did, But I Don't Know

Client

addEvent("python-test", true) 
 addEventHandler("python-test",root, 
 function() 
 setElementData(localPlayer,"wins", (getElementData(localPlayer,"wins") or 0) + 1) 
 end 
 ) 

Server

function testing () 
     triggerClientEvent(client, "python-test", client, kazanma) 
end 
addEventHandler ( "onPlayerFinish", root, testing ) 

Link to comment

Use source not client, the triggerEvent line shows that the base element (source) is the player who finished the race. So, both client and kazanma is not defined.

Why are you triggering a client event just to set the element data? You can do just that on the server-side.

Link to comment
  • Moderators

Firstly there is no problem to set an element data from the client-side.

Secondly, when you set an element data on one side (for example server side), then it's automatically available on the other side by default (for example client-side). So there is no need to send it again using a trigger.

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