generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: NPC Rendering

Previous Thread :: Next Thread 
iSymon is not online. 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
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
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 is not online. 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 is online. Zued
Joined: 18 May 2015
Total Posts: 506
03 Dec 2016 06:36 PM
Why did you make them client sided?


Report Abuse
iSymon is not online. 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
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
03 Dec 2016 06:43 PM
try the way i suggested (i want to know if it works)
Report Abuse
iSymon is not online. 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
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
03 Dec 2016 07:45 PM
why don't you just load 'chunks' of the world??
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image