View Single Post
  #1  
Old 10-18-2014, 01:07 AM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Clientside vs Serverside confusion

So I always wondered something.

Let's say, you have a weapon in a player that does this.
PHP Code:
//#CLIENTSIDE
function onCreated(){
 
onTimeOut();
}

function 
onTimeOut(){
 
setTimer(0.1);
 
player.+= 1;

The player will just keep moving right. And all other players can see that movement being done also.


Now lets apply the same thing to a npc..
PHP Code:
function onCreated(){
 
onTimeOut();
}

function 
onTimeOut(){
 
setTimer(0.1);
 
this.+= 1;

The NPC keeps moving to the right. Everyone can see it. Great.
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:
//#CLIENTSIDE
function onPlayerTouchsMe(){
 
this.chat "Touch";

Why can't everyone in the area see the change in function of the same NPC. Is there a way to do this all in clientside? (Showing same NPC movement for all players in real-time)
Reply With Quote