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: Need help, AI Patrol script

Previous Thread :: Next Thread 
RamaKpo1 is not online. RamaKpo1
Joined: 31 Jan 2011
Total Posts: 5289
20 Sep 2014 12:56 PM
Hello

1) How can I make an AI, let's say, ai's name is "Dummy"
I want "Dummy" to patrol from Point A, to point B, point C, point D, and then repeat.
How can I do that? Thanks!

---
2) How can I make an AI stop 'patrolling' or walking from Point A to D when a player is near? As in, let's say it's a cop with a baton. I want "Dummy" to stop patrolling and to attack the player until he's dead. I want to make it so "Dummy" doesn't attack him until the player is in his range of view OR until the player is X amount of studs away, let's say either 5 or 10.

Thanks beforehand.
Report Abuse
RamaKpo1 is not online. RamaKpo1
Joined: 31 Jan 2011
Total Posts: 5289
20 Sep 2014 12:58 PM
Answer both questions, or each separately please, and again, thanks.
Report Abuse
SirNoobly is not online. SirNoobly
Joined: 01 Oct 2009
Total Posts: 253
20 Sep 2014 12:58 PM
1) You would have to use the ROBLOX Pathfinding service for that, idk how to use it google it.
2)Use magnitude for this.
Report Abuse
RamaKpo1 is not online. RamaKpo1
Joined: 31 Jan 2011
Total Posts: 5289
20 Sep 2014 12:59 PM
@SirNoobly
I was looking at the ROBLOX Pathfinding service on the ROBLOX Studio page, but I couldn't really understand how to use it.

And for the magnitude, I'm a rookie, I don't know much but I'll see what can I do, I would like some sort of tutorial or explanation with steps or something alike if possible, anyways, thanks.
Report Abuse
RamaKpo1 is not online. RamaKpo1
Joined: 31 Jan 2011
Total Posts: 5289
20 Sep 2014 01:06 PM
Sorry, bump.
Report Abuse
Krypticon is not online. Krypticon
Joined: 12 Feb 2014
Total Posts: 680
20 Sep 2014 02:01 PM
Say for example I had part1 at position 0,0,0 and part2 at position 0,10,0. If I wanted to get the distance between the two points I would use magnitude. I would type something like:

print((Workspace.part1.Position-Workspace.part2.Position).magnitude)

and that would print '10'. Because to use magnitude you just type 2 positions minus each other in a set of brackets then type '.magnitude' after the brackets and it returns the magnitude.

To make your 'Dummy' go to the nearest position you would constantly cycle through the list of players, get their characters- check if the magnitude between them is less than say 10, if so use Pathfinding to attack chase and attack them until they're dead.

Hope this helps. :)
Report Abuse
RamaKpo1 is not online. RamaKpo1
Joined: 31 Jan 2011
Total Posts: 5289
20 Sep 2014 07:15 PM
Yeah it helped a lot, but I still don't really know how to get the script to work, or how to even do it. I don't know much of the LUA language; a bit of editing and writing.
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