ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
|
| 25 May 2013 05:35 PM |
Got on my level bro.
BTW: The first 50 lines are the grid lines (Lines used to generate the grid), the pathfinder doesn't start until line 50, (aka function search)
This is 49 lines :)
PS: The pathfinder is built so that if it gets to a path, and the path ends up being "bad" (one way) it will go to its last known working spot and continue from there
>:D
I`ll post it here but I`ll cut out the bits that count:
local cross = 0 local row = 0
local base = workspace.Base local ai = "" local endpart = ""
for ii = 1, 20 do
cross = 0 wait() for i = 1, 20 do block = game.Lighting.Floor:clone() block.CFrame = base.CFrame-Vector3.new((base.Size.X/2)-(1/2*block.Size.X)-cross*10, 0, (base.Size.Z/2)-(1/2*block.Size.Z)-row*10) block.Parent = base block.Name = "Floor" ..cross.. ":" ..row rando = math.random(1,3) if rando == 1 then block.Name = "Wall" block.BrickColor = BrickColor.new("Black") end if row == 0 and cross == 0 then ai = block block.Name = "Start" block.BrickColor = BrickColor.new("Bright blue") local int = Instance.new("StringValue") int.Name = "Distance" int.Value = 0 int.Parent = block end if row == 19 and cross == 19 then endpart = block block.Name = "End" block.BrickColor = BrickColor.new("Bright red") end cross = cross+1 end
row = row+1 end
local closed = {} local smallest = 999999 local smallestpart = ""
function search() wait(0.1) for i,v in pairs(base:GetChildren()) do if (v.Position-ai.Position).magnitude < 15 then if v:findFirstChild("Distance") ~= nil then if v.BrickColor == BrickColor.new("Bright violet") then v.BrickColor = BrickColor.new("Bright green") v.Distance:Destroy() v.Owner:Destroy() end end end end for i,v in pairs(base:GetChildren()) do if v ~= endpart and v ~= ai and v.Name ~= "Start" and v.Name ~= "End" and v.Name ~= "Wall" and v:findFirstChild("Distance") == nil and (v.Position-ai.Position).magnitude < 15 then v.BrickColor = BrickColor.new("Bright violet") local int = Instance.new("StringValue") int.Name = "Owner" int.Value = ai.Name int.Parent = v local int = Instance.new("NumberValue") int.Name = "Distance" int.Value = PRIVATE U NUB if PRIVATE U NUB then PRIVATE U NUB PRIVATE U NUB end int.Parent = v end end
table.insert(closed, ai)
smallestpart.BrickColor = BrickColor.new("Bright yellow")
if PRIVATE U NUB then print("Done!") else PRIVATE U NUB PRIVATE U NUB search() end end
search() |
|
|
| Report Abuse |
|
|
| |
|
| |
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
|
| 25 May 2013 05:36 PM |
| Bragging about wits is allowed, according to Tony Stark :P |
|
|
| Report Abuse |
|
|
|
| 25 May 2013 05:37 PM |
I see your game didnt get on the front page again
-- No just no -- |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
|
| 25 May 2013 05:37 PM |
| Its ok I earned enough robux to reinact that. @bellic |
|
|
| Report Abuse |
|
|
iwantpsp
|
  |
| Joined: 07 Sep 2010 |
| Total Posts: 14291 |
|
|
| 25 May 2013 05:38 PM |
| Well,I'm gonna mess around with this script and change the numbers. |
|
|
| Report Abuse |
|
|
|
| 25 May 2013 05:38 PM |
| Well done here's a cookie.... |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
|
| 25 May 2013 05:39 PM |
| @Iwant I put PRIVATE U NUB at the important parts that make this work. |
|
|
| Report Abuse |
|
|
Fuzion217
|
  |
| Joined: 13 Jan 2009 |
| Total Posts: 30893 |
|
|
| 25 May 2013 05:39 PM |
Care: -5
Follow me on Twitter @Fuzion217RBLX |
|
|
| Report Abuse |
|
|
|
| 25 May 2013 05:41 PM |
Wait, what?
~When life gives you lemons, you squeeze it back to life's eyes!~ |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
|
| 25 May 2013 05:46 PM |
its for my upcoming zombie game.
The terrain is randomly spawned (my terrain, not roblox's), and then these smart-zombies find you.... >:D |
|
|
| Report Abuse |
|
|
|
| 25 May 2013 05:49 PM |
| Sounds cool, but I recommend using A*. |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
| |
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
Fuzion217
|
  |
| Joined: 13 Jan 2009 |
| Total Posts: 30893 |
|
|
| 25 May 2013 05:55 PM |
@Script
I'm an older user than you, and I have more posts. By no means am I a noob.
Follow me on Twitter @Fuzion217RBLX |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 25 May 2013 05:56 PM |
| @Fuzion: My account is older and I have even more posts. That proves nothing. |
|
|
| Report Abuse |
|
|
Fuzion217
|
  |
| Joined: 13 Jan 2009 |
| Total Posts: 30893 |
|
|
| 25 May 2013 05:59 PM |
"My account is older and I have even more posts. That proves nothing."
Noob means new, so yes, join date means something.
Also, point count means something to, cause it means I'm not new to the forums.
And no, I'm not saying anyone here is a noob. I'm simply stating that I'm not one.
Follow me on Twitter @Fuzion217RBLX |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
|
| 25 May 2013 06:01 PM |
| @fuz, actually, I`m an older user than you. I have a 2008 account named genya10g. kthxbai. |
|
|
| Report Abuse |
|
|
777MrEpic
|
  |
| Joined: 17 Oct 2012 |
| Total Posts: 3998 |
|
| |
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
carl164
|
  |
| Joined: 04 Apr 2012 |
| Total Posts: 35052 |
|
|
| 25 May 2013 06:13 PM |
loled at all of the newbags saying get out
hi |
|
|
| Report Abuse |
|
|
ScriptOn
|
  |
| Joined: 22 Aug 2010 |
| Total Posts: 10885 |
|
| |
|
turbodaze
|
  |
| Joined: 17 Dec 2008 |
| Total Posts: 2169 |
|
| |
|