Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do I Kill a player on the client side?
#4
(19.02.2020, 19:49)Patrix Wrote: Calling a setPlayerHealth function on client-side will only kill the hero or npc for a client.
This action won't be synced, because it doesn't have any sense to synchronize things that are executed on the client-side.
That's why you have the server-side, calling a setPlayerHealth on server-side will cause to set a packet to every player and sync the action.
Also, consider example when calling a client-side function will automatically sync this with the server, that way server will have to TRUST the data from the client, and that's bad in most cases.
Why is it bad? Because it gives the client(s) abitility to fool the server by sending the value that client wants to send, that way client could manipulate the server actions (in some way).

The question is what are you trying to achieve?
You want to kill a player, but why do you want to make this on client-side?
For example: players should be punished for not using an item. But the "onUseItem" event is on the Client side.

(19.02.2020, 19:49)Patrix Wrote: Calling a setPlayerHealth function on client-side will only kill the hero or npc for a client.
This action won't be synced, because it doesn't have any sense to synchronize things that are executed on the client-side.
That's why you have the server-side, calling a setPlayerHealth on server-side will cause to set a packet to every player and sync the action.
Also, consider example when calling a client-side function will automatically sync this with the server, that way server will have to TRUST the data from the client, and that's bad in most cases.
Why is it bad? Because it gives the client(s) abitility to fool the server by sending the value that client wants to send, that way client could manipulate the server actions (in some way).

The question is what are you trying to achieve?
You want to kill a player, but why do you want to make this on client-side?
oh! You Patrix. It was you who had the problem with "ItemsGround.spawn" ? I have it, too, appears: Half of the players on the server do not see items.
Reply


Messages In This Thread
RE: how do I Kill a player on the client side? - by demor140202 - 24.02.2020, 11:15

Possibly Related Threads…
Thread Author Replies Views Last Post
  Give random item for Player liegav 6 6,363 14.02.2018, 18:30
Last Post: Patrix
  0.0.5.1 getID client HammelGammel 2 2,870 29.12.2016, 02:45
Last Post: HammelGammel
  Call client functions from server Osmith 1 2,725 25.08.2016, 15:35
Last Post: Bimbol

Forum Jump:


Users browsing this thread: 1 Guest(s)