eseth3
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 109 |
|
|
| 27 Nov 2014 09:08 PM |
Hi I'm trying to make a turret. So far I have it shooting but something is wrong with the aim script. Whenever I group two Zombies together to make a group the turret no longer aims at them, but when they are un-grouped it works completely fine.
function findNearestTorso(pos) -- Locals -- local list = game.Workspace:GetChildren() -- Grabing Groups from Workspace -- local torso = nil local distance = 150 local test = nil local test2 = nil local zomb = nil ------------ -- Finding Torso and Confirming Alive -- ------------ for x = 1, #list do test2 = list[x] if (test2.className == "Model") and (test2 ~= script.Parent) then test = test2:findFirstChild("Torso") zomb = test2:findFirstChild("Zombie") if (test ~= nil) and (zomb ~= nil) and (zomb.Health > 0) then if (test.Position - pos).magnitude < distance then torso = test distance = (test.Position - pos).magnitude end end end end return torso end |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2014 09:17 PM |
step1) dont use free models step2) learn to script |
|
|
| Report Abuse |
|
|
eseth3
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 109 |
|
|
| 27 Nov 2014 09:36 PM |
| "Google it" "Learn how to script" Do this. Do that. Jesus I just want some help with this simple ******* script! God.. No one ever helps you on this forum unless you are a "Professional Scriptor" Wahoo! SO what.. Everyone has used free models from now and then. Are you telling me it's wrong just to use some help from someone elses script that THEY published to give out to others. I'm just trying to make a simple ******* turret and everyone just keeps telling me "Learn how to script" "goggle it".. God.. Would someone please take 5 MINUTES of their time to help me with this one ******* script! and I will be on my way. |
|
|
| Report Abuse |
|
|
eseth3
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 109 |
|
|
| 27 Nov 2014 09:38 PM |
| Guess I'm just not as smart as the rest of you Genius people -_- |
|
|
| Report Abuse |
|
|
eseth3
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 109 |
|
|
| 27 Nov 2014 09:45 PM |
| You know what.. Forget it I'll just go and forget about it. [Thread Closed] |
|
|
| Report Abuse |
|
|
GOLDC3PO
|
  |
| Joined: 31 May 2011 |
| Total Posts: 509 |
|
|
| 27 Nov 2014 09:46 PM |
function findNearestTorso(pos,list) if list == nil then list = game.Workspace:GetChildren() -- Grabing Groups from Workspace -- end local torso = nil local distance = 150 local test = nil local test2 = nil local zomb = nil ------------ -- Finding Torso and Confirming Alive -- ------------ for x = 1, #list do test2 = list[x] if test2:FindFirstChild("Torso") and test2:FindFirstChild("Zombie") then else findNearestTorso(pos,test2) end if (test2.className == "Model") and (test2 ~= script.Parent) then test = test2:findFirstChild("Torso") zomb = test2:findFirstChild("Zombie") if (test ~= nil) and (zomb ~= nil) and (zomb.Health > 0) then if (test.Position - pos).magnitude < distance then torso = test distance = (test.Position - pos).magnitude end end end end return torso end |
|
|
| Report Abuse |
|
|