|
| 17 Dec 2015 10:46 PM |
local update_time = .3 local num = 1
while wait(update_time) do local number = game.Workspace.Map:GetChildren() for i = 1,#number do if number[i].ClassName == "Part" and number[i].Transparency == 1 and number[i].Anchored == true then for i = 1,6 do local vector_direction = Vector3.new(0,0,0) local direction_table = {"Top","Bottom","Left","Right","Front","Back"} if num == 1 then vector_direction = Vector3.new(0,4,0) end if num == 2 then vector_direction = Vector3.new(0,-4,0) end if num == 3 then vector_direction = Vector3.new(-4,0,0) end if num == 4 then vector_direction = Vector3.new(4,0,0) end if num == 5 then vector_direction = Vector3.new(0,0,-4) end if num == 6 then vector_direction = Vector3.new(0,0,4) end print(number[i]) if num ~= 7 then local ray = Ray.new(number[i].Position,vector_direction) local ignore = number[i] local block, position, normal = game.Workspace:FindPartOnRay(ray, ignore) if block and block.Parent:FindFirstChild("Humanoid") == nil and block.Size == number[i].Size then if number[i]:FindFirstChild(direction_table[num]) ~= nil then local d = number[i]:FindFirstChild(direction_table[num]) d:remove() end elseif block == nil then if number[i]:FindFirstChild(direction_table[num]) == nil then local s = game.ReplicatedStorage.Grass:FindFirstChild(direction_table[num]):Clone() s.Parent = number[i] end num = num + 1 if num >= 7 then num = 1 end end end end end end end --No questions from anyone why I did this. --I just need some kind of idea by anyone how to fix this error and/or the steps to doing so
23:33:34.840 - Workspace.Script:21: attempt to index field '?' (a nil value) 23:33:34.841 - Stack Begin 23:33:34.843 - Script 'Workspace.Script', Line 21 23:33:34.843 - Stack End |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2015 11:12 PM |
| I'm guessing that the people who read the code were very confused and just gave up. ;I |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 17 Dec 2015 11:54 PM |
maybe your way of asking for help was horrible and nobody wanted to help you
im not going to count which is line 21 |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2015 11:58 PM |
| I'm not stupid I can read error logs. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2015 12:01 AM |
| Actually no one can be bothered reading and understanding that code. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2015 12:23 AM |
| Well if you only told us what it does, how you want it to go vs real outcome, and where tf is line 21, then we can help. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2015 12:46 AM |
| Good news, I can't even understand the code completely either. I just posted it for some kind of support for learning how to do it more efficiently. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2015 12:53 AM |
| I posted a modified version of my old script in the forums. It works great for mining games or something. |
|
|
| Report Abuse |
|
|
chimmmihc
|
  |
| Joined: 24 Jul 2014 |
| Total Posts: 2420 |
|
|
| 18 Dec 2015 06:02 AM |
| Why does this do? What is line 21? And why don't you comment code? |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2015 06:37 AM |
This isn't complex at all, acting cocky will not get your help.
Here's your problem:
local ignore = number[i]
number[i] is nil. |
|
|
| Report Abuse |
|
|