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 » Scripting Helpers
Home Search
 

Re: VERY insufficient zombie follow script

Previous Thread :: Next Thread 
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
27 Oct 2012 11:47 PM
zombiehum = script.Parent.Humanoid
player = (game.Players:GetPlayers())
while true do
wait()
for i, v in pairs(game.Players:GetPlayers()) do
if v:IsA("Player") then
c = v.Character.Torso.Position
zombiehum:MoveTo(c, Workspace.Base)

end
end
end
-----------
How do I make it more efficient? Doesn't seem to hard but the problem is he targets 1 person when that person dies he targets the next person forever...
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
28 Oct 2012 12:14 AM
bump
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
28 Oct 2012 12:20 AM
Take NPC Wait Animation,

or for AI, take Speed AI
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
28 Oct 2012 12:22 AM
zombiehum = script.Parent.Humanoid

function getClosestPlayer()
local max, found = 5000
for _, v in pairs(game.Players:GetPlayers()) do
if v.Character and v.Character:FindFirstChild("Torso") then
local mag = (v.Character.Torso.Position-script.Parent.Torso.Position).magnitude
if mag < max then
max = mag
found = v
end
end
return found
end


while true do
wait()
local c = getClosestPlayer().Character.Torso.Position
zombiehum:MoveTo(c, Workspace.Base)
end
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
28 Oct 2012 12:26 AM
Dang.. it worked and your awesome.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
28 Oct 2012 12:27 AM
"Dang.. it worked"

I know.


" and your awesome."

I know.
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
28 Oct 2012 12:29 AM
I remember looking back at AFF a couple years back, I thought he was epic cause of his name.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
28 Oct 2012 12:30 AM
Funny thing I didn't even create this account. My brother did. XD
MY account's name is GamingPro.

>_>
Report Abuse
XxChopSlaperxX is not online. XxChopSlaperxX
Joined: 09 Nov 2010
Total Posts: 3112
28 Oct 2012 12:32 AM
Lol'd

http://www.roblox.com/User.aspx?ID=527254
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
28 Oct 2012 12:38 AM
Yeah he showed me this game and I made GamingPro and he was like "that's a dumb name let me make you a better name." Then he made this account for me.

XD
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
28 Oct 2012 12:38 AM
May I ask for a bit more help please?

http://www.roblox.com/Forum/ShowPost.aspx?PostID=80982939
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
28 Oct 2012 12:41 AM
> I remember at AFF a couple years back, I thought he was epic cause of
> his name. looking back

Yeah, he's not epic anymore, right? :P

¤ ¤ †KMXD† ¤ ¤
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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