![]() |
Clientside vs Serverside confusion
So I always wondered something.
Let's say, you have a weapon in a player that does this. PHP Code:
Now lets apply the same thing to a npc.. PHP Code:
But why can't the NPC be clientside also? Does client and serverside work different between players and NPCs? For example, if I have this on a NPC... PHP Code:
|
Okay, to help you out here.
Not all player variables can be edited client side. Player's x and y can. Player's chat also can. But things like hearts, ap, and mp cannot. With NPC's when you are doing client side it will only show for the client, and server side shows for everyone. There are some exceptions. When you place bomb explosions for example, or use an on exploded event. These will show for all players. It can be tricky to exactly pinpoint what will, and what will not show for one player, or all others. It's best to experiment. |
PHP Code:
|
Some flags are synchronized between clientside, besides the chat, x/y theres also tge players attributes (player.attr[#]) which are synchronized. Not all flags are and you cant specify on your own wether a flag should be synchronized or not, for that purpose you would use player.client.flag (watch out: player.client.flag not player.clientr.flag)
|
Quote:
I feel like no one here really anwsered your question. The difference between clientside and serverside is that when something happens on client It HAPPENS for you since its on your client. So if your changing a npc looks or lets say its chat under //#CLIENTSIDE, thats only happening for you. However if you removed the clientside portion, the changes would be done on serverside that all players are synced to, all players would see the changes. when you do playertouchsme on clientside its only changing the clientside coords thats within the playerscope thats touching it. However if you did it on serverside its still within the playerscope but your changing the server coords that all players are synced to. |
Quote:
That actually really helps. Thank you. But here's a scenario Let's say the player does this: PHP Code:
|
Quote:
|
you can however hide your player, and have an artificial npc take those action you want him to do clientside :p
|
| All times are GMT +2. The time now is 03:44 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.