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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Children

Previous Thread :: Next Thread 
eseth3 is not online. 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
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
27 Nov 2014 09:17 PM
step1) dont use free models
step2) learn to script
Report Abuse
eseth3 is not online. 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 is not online. 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 is not online. 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 is not online. 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
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