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
 

How do i prevent Path finding AI from following each other?

Previous Thread :: Next Thread 
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:11 PM
So I need do do something in this code that will tell the zombie to ignore other zombies I want to just tell the zombie not to follow anyone with the name "Zombie" but I have no idea how to do that. (The zombies use path finding) who ever can show me how to do this gets a cookie.

After I get the help I'm looking for ill stick to scripting my obby and learning new things.

=================================================================
function findNearestTorso(pos)
local list = game.Workspace:children()
local torso = nil
local dist = 200
local temp = nil
local human = nil
local temp2 = nil
for x = 1, #list do
temp2 = list[x]
if (temp2.className == "Model") and (temp2 ~= script.Parent) then
temp = temp2:findFirstChild("Torso")
human = temp2:findFirstChild("Humanoid")
if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
if (temp.Position - pos).magnitude < dist then
torso = temp
dist = (temp.Position - pos).magnitude
end
end
end
end
return torso
============================================================
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:14 PM
Also noting this is a free model
Report Abuse
JohnnyThunder2 is not online. JohnnyThunder2
Joined: 11 Apr 2009
Total Posts: 1043
03 Aug 2016 01:16 PM
function findNearestTorso(pos)
local list = game.Players:GetPlayers()
local torso = nil
local dist = 200
local temp
for i,v in ipairs(list) do
local c=v.Character
if c.Humanoid.Health>0 then
if (c.Torso.Position - pos).magnitude < dist then
torso = c.Torso
--dist = (torso.Position - pos).magnitude
--what's this for? I commented it out
end
end
end
return torso
end

I think you missed an "end" in your original function, you can't finish on "return"
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:19 PM
Johnyy funder thank you so much it seems to have worked
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:24 PM
I feel a built guilty for milking the scripter forums just to for my personal needs
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:25 PM
"a bit" not "a built"
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:30 PM
Also do you happen to know how to make rays from raycastguns do damage to these zombies. I know linkswords can do damage to the zombies but not raycast for some reason.


this is the last thing i will milk from the scripting forums
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 01:48 PM
why the heck did you make multiple threads

https://forum.roblox.com/Forum/ShowPost.aspx?PostID=195270491
there was a 3rd one linked on that forum


why do you insist you can script if you can't

why do you refer to us as cows
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:58 PM
Wowgnomes

dude I'm a beginner i can't do anything complex yet obviously because i'm a beginner so technically i was not lying

I want to know to code new things and i find it quite interesting so I don't see what your problem is and your lying about me calling you "cows" so now I can't take you seriously anymore lol and I don't care that your blind.
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 01:59 PM
Also i told you i'm using a free model so i don't know why you so mad.
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 02:03 PM
When i said "this is the last time ill be milking the scripting forums" i meant it as an exspression.
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