|
| 30 Dec 2016 11:55 AM |
so i have these ai that walk around and slash at the closest player
but when i have a bunch it starts to lag real bad
is there a way to reduce the lag or get rid of it
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:31 PM |
bump
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:32 PM |
any loops?
if not set the network owner to the server and see if that reduces the lag
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:34 PM |
@Sir
i don't think so
also what do you mean
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:39 PM |
by loops he means like
for i = something
while true do |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:40 PM |
assume tab is a table with all the bots
for i,v in pairs(tab) do for j,k in pairs(v:GetChildren()) do if k:IsA("Part") and k:CanSetNetworkOwnership() then k:SetNetworkOwnership(nil) end end end
try that
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:41 PM |
side note: the bots might load slower because it loads on the server first, but hey if it reduces lag go with the flow
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:45 PM |
| ###################################################################################################################################################################################################################################### |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:46 PM |
| ###################################################################################################################################### |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:46 PM |
| ################################################################################################################################################################ |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:47 PM |
| # ## ## ## ### /c8782d1a93d6aa9dd527c74c7c736ceb this is what i mean Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:47 PM |
| wow this filter it's a ##### link /c8782d1a93d6aa9dd527c74c7c736ceb Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:48 PM |
gee
y
a
zee
o
/c8782d1a93d6aa9dd527c74c7c736ceb
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:53 PM |
are that many npc's necessary?
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:57 PM |
"are that many npc's necessary?"
well the rounds are going to spawn noobs out slowly
probably up to like 150 for the final stage
im afraid this is going to be a problem
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 02:58 PM |
did you change the network ownership to the server
if you did, did it help?
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 03:00 PM |
i put this script in every noob
for i,v in pairs(script.Parent:GetChildren()) do if v:IsA("Part") or v:IsA("UnionOperation") then if v:CanSetNetworkOwnership() then v:SetNetworkOnwership(nil) end end end
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Dec 2016 03:04 PM |
oh oops
it was equally laggy
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 03:08 PM |
| are you handling them on the server? or the client? you could handle the calculations for following the player on the client, so it would basically depend on good internet speed. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 03:09 PM |
im handling them on the server
i just have the ai find the nearest torso and follow it
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 03:11 PM |
| but with a lot of npc's that can get laggy, have the client handle it. Like have the server fire a remoteevent back to the client, asking it to calculate. then have it said it back to the server, and have the server run it. so the client makes the calculations, but the server runs the npc. i think that might help a bit. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2016 03:17 PM |
"but with a lot of npc's that can get laggy, have the client handle it. Like have the server fire a remoteevent back to the client, asking it to calculate. then have it said it back to the server, and have the server run it. so the client makes the calculations, but the server runs the npc. i think that might help a bit."
i feel like it's still going to lag
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Dec 2016 03:21 PM |
i've isolated the issue
when i took out the script that deals with the sword being touched there's no lag
how do i optimize that then
script.Parent.Handle.Touched:connect(function(hit) if hit.Parent~=nil then if hit.Parent:findFirstChild("Humanoid") then local h = hit.Parent.Humanoid if not damage then damage = true if a then h:TakeDamage(math.random(script.Parent.minDmg.Value,script.Parent.maxDmg.Value)) wait(1) end damage = false end end end end)
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|