iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 03 Dec 2016 06:15 PM |
I have a script that render NPCs. - When you join an area they appear (by the client) - When you leave they disappear (by the client also)
The problem is, two players can't attack the same NPC because the NPC was cloned from the client meaning another client won't see the same NPC as the other one. (They'll be attacking two different ones)
How to work my way around this ? I really need this rendering script to prevent lag.
I hope I'm making sense.
ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 06:18 PM |
| i don't know if this will work, but when a client deals damage, fire for the server to fire to all clients, with the npc name and damage specify. then every client can check to see if the npc exists, and subtract the health accordingly |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 03 Dec 2016 06:27 PM |
this is annoying me :o
ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ |
|
|
| Report Abuse |
|
|
Zued
|
  |
| Joined: 18 May 2015 |
| Total Posts: 506 |
|
|
| 03 Dec 2016 06:36 PM |
Why did you make them client sided?
|
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 03 Dec 2016 06:39 PM |
-- FE is enabled
They're rendered on the client meaning the clients handles the NPCs being removed and being placed when in and out of range. Each NPC model is stored in a storage being cloned into workspace into it's proper location by the client when in range. When out of range each NPC in that area will be removed. Since the client does this, other players won't be able to attack the same NPC.
If I render them on the server what would be the point in reducing lag and rendering anyway if the NPCs are going to be loaded on every client (whenever one client enters the area).
ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 06:43 PM |
| try the way i suggested (i want to know if it works) |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 03 Dec 2016 07:43 PM |
That way didn't work properly, but I thought of something else. What if I just render the things that causes the lag ? Armour, Scripts, weapons, etc. The only concern I have with this is the scripts (not too sure if it'll work).
ヽ༼ຈل͜ຈ༽ノ raise your dongers ヽ༼ຈل͜ຈ༽ノ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 07:45 PM |
| why don't you just load 'chunks' of the world?? |
|
|
| Report Abuse |
|
|