Jump to content

math calculation inside "triggerServerEvent


IIYAMA

Recommended Posts

  • Moderators
Posted

Hello,

Question: will math.floor be calculated at server or client side? I don't know, because it is maybe possible that the math will be send with the trigger. I use math.floor to reduce high bandwidth.

triggerServerEvent("S_SHOOT",getLocalPlayer(),weapon,aHits,math.floor(sX), math.floor(sY), math.floor(z),getTickCount()/1000*45); 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted (edited)

On the client, because think of it this way: if you'd pass the instructions to some player element, the server still wouldn't know what is meant. It needs the absolute object reference which is returned by the instructions. Therefore, the client always evals the instructions before sending them to the server.

Edited by Guest
  • Moderators
Posted

I see players teleport with it already, lal.

But thank you very much.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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