What I'm attempting to achieve is spawning NPCs (probably on the client) but only being able to see so many around you. I have things already where I can get the look of said NPC; All I need to know is how I would make some show and others not (until needed) If this doesn't make sense, please feel free to ask questions! I'd really appreciate the help.
Edit: I'm sorry if people feel this is against the rules. I'm just not sure how else to get this information. I have checked this site, I have checked the forums and I have googled it. I just want further information to help me accomplish my goal. If this is against the rules then I'd like to know where I can get a more helpful website that won't judge me because I don't know something and I am trying to get more information. Thank you
Please refer to my comment on your post. Im not sure if this is allowed as I'm not really posting a solution, but this may be helpful.
Check the radius around your character to check for NPCs using Region3 or magnitude. If the amount is greater than x (your cap amount of npcs) then parent the furthest ones to nil. You can check the distance with magnitude. You would have to constantly fire or check though I believe, but this is just my 2 cents. Cheers
Try using the .Magnitude property by subtracting the npc's position (assuming the npc is stationary) and the player's head.
if (npc.Position - Player.Character.Head.Position).Magnitude > desiredRenderDistance then npc.Transparency = 1 else npc.Transparency = 0 end
If you have that script run constantly, the code should always be checking if the distance between the you [the player] and the npc is too far thus making it invisible. If you dont want it to even show up I believe you set the parent to nil like infocus said. Good luck! Hope this works!
This is not an ASKING WEBSITE. Its against the Community Guidelines to give an answer with a question. Its in Website Guidelines area in Community Guidelines and line 2. I see you have 295 reputation and you should already know this! Please do not post another one like this or you can have a chance of being banned for Mass guideline breaking