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.x += 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.x += 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)