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: Need to prevent Zombie AI from following other zombies

Previous Thread :: Next Thread 
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:20 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.

=================================================================
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 12:21 PM
Holy cr@p just realised I've spent the whole day doing this.
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:22 PM
if (temp2.Name ~= "Zombie") then
Report Abuse
iJacobness is not online. iJacobness
Joined: 20 Jan 2014
Total Posts: 4944
03 Aug 2016 12:23 PM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=195258467


Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:23 PM
Why you post a link to my other thread?
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:24 PM
Wow jacob, literally everyone today is just having stolen scripting valor huh?
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:24 PM
nvm
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:26 PM
WHAT DO YOU MEAN NEVERMIND I GAVE YOU THE ANSWER
WAY TO SAY THANKS MAN
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:29 PM
no i was saying nvm to jackob

I don't know where to put your code yet so i wont thank you untill i figure it out
Report Abuse
iJacobness is not online. iJacobness
Joined: 20 Jan 2014
Total Posts: 4944
03 Aug 2016 12:30 PM
you dont know where to put it cause u cant script lol


Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:31 PM
I would reccomend putting it near the rest of the code that looks similar to if (temp2.something) and (temp2.somethingelse) then
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:32 PM
I can script just not this good
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:34 PM
can you please not lie to our faces as if we were idiots?
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:34 PM
want me 2 prove it?
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:36 PM
what comes after "then" in if (temp2.Name ~= "Zombie") then
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:38 PM
if (temp2.className == "Model") and INSERT HERERERERERERE and (temp2 ~= script.Parent) then


dont act as if we are idiots dude

it is very apparent that you cannot script
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:45 PM
well i did exactly what you said but it didn't work



if (temp2.className == "Model") and if (temp2.Name ~= "Zombie") then and (temp2 ~= script.Parent) then
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:48 PM
Just for the record i can do basic things like use the touch function and basic stuff like that
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:50 PM
function touch(hit)

hit.Parent.Transparency = 1
end
script.Parent.Touched:connect(touch)


this should make anything that touches the parent invisable
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:51 PM
might have to post this thread again lol
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
03 Aug 2016 12:52 PM
No. Don't post this thread again.

what is the name of your zombies

change their exact name to "Zombie" or change "Zombie" to their exact name
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:53 PM
The name of my zombies is "Zombie"
Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:55 PM
there's an error "if" is underlined in red



Report Abuse
Tobycon is not online. Tobycon
Joined: 22 May 2013
Total Posts: 1527
03 Aug 2016 12:56 PM


would tell you the eror but the forum wont let me post the error and says "bad request"
Report Abuse
Flashiness is not online. Flashiness
Joined: 25 Dec 2012
Total Posts: 1212
03 Aug 2016 01:00 PM
>if (temp2.className == "Model") and if (temp2.Name ~= "Zombie") then and (temp2 ~= script.Parent) then

if and then then

>i can script

believable


what do
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