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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 31 Jan 2011 |
| Total Posts: 5289 |
|
| |
|
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
|
  |
| 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 |
|
|