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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
|
| 03 Aug 2016 01:14 PM |
| Also noting this is a free model |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 22 May 2013 |
| Total Posts: 1527 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|