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
|
  |
| 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
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 03 Aug 2016 12:22 PM |
if (temp2.Name ~= "Zombie") then
|
|
|
| Report Abuse |
|
|
|
| 03 Aug 2016 12:23 PM |
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=195258467
|
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 03 Aug 2016 12:30 PM |
you dont know where to put it cause u cant script lol
|
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
|
| 03 Aug 2016 12:32 PM |
| I can script just not this good |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
|
| 03 Aug 2016 12:51 PM |
| might have to post this thread again lol |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
|
| 03 Aug 2016 12:53 PM |
| The name of my zombies is "Zombie" |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|