cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 10:46 AM |
So I was making a zombie script that uses region3 (idk why) and then whenever I try to use table.insert(something,something2), it says:"attempt to call field 'insert' (a nil value)" What?? If i do blah[index]=blah2 there's no error, but the thing isn't inserted... wut Please look at the area where it says **
function can_see(table) local t=table local c={} Spawn(function() for _,character in pairs(t) do for i=-1,1,.5 do--fires like \\|// local r=Ray.new(head.CFrame.p,(((character.Head.CFrame.p-head.CFrame.p).unit*(Area))+Vector3.new(0,0,i))) local hit,pos=game:GetService('Workspace'):FindPartOnRayWithIgnoreList(r,ignore,true) if hit and pos then if hit:IsDescendantOf(character) then if not already(c,character) then--checks if i already put in table **table.insert(c,character) print('once') end --print('i c u') else print('i dun c u') end end--hit right descend? end--hit and pos? end end) print('i return u') return c end
|
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 10:52 AM |
| blump bumb poump biamp bawmp |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 11:00 AM |
| blrblrblr awdsoadska dij -_- is someoene gonna help. |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 11:12 AM |
| 9a sudmoasd9a sud9as uda siuas idwapsdiuasidwipasduwiapsuia usipaw sipa |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 11:15 AM |
| bump 90000000000000000000000000 wt'fmannorrespondwth): |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 11:18 AM |
| aaaaaaaaaaaaaaaaaaaaaaaaaarshoollllllllllllllock |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
|
| 21 Dec 2013 11:27 AM |
Wait doesn't insert have a capital I
【◄[ϟ]〓☜✪ xWOWZABOYx; FCOM, SQN COM, Scientist, Veteran, Visionary ✪☞〓[ϟ]►】 |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
| |
|
DrWaffler
|
  |
| Joined: 16 Sep 2011 |
| Total Posts: 4248 |
|
|
| 21 Dec 2013 11:30 AM |
function can_see(table) local t=table
That's why.
You can't use table as a variable like that. Use tab instead, that is most common from what I see.
function can_see(tab) local t = tab --stuff table.insert(name of the table, what to insert)
This is just a suggestion I have, but I usually use lower to upper format for naming things like functions and variables if they're more than word word/phrase.
instead of can_see I would do canSee.
onTouch, playerList, rarityTable, canSee
just as examples.
It is also how I use method names
findFirstChild, getChildren, getPlayers
to name some examples.
Consistency makes life easy! :D
--[Territory Conquest Developer, Valerian Studios Developer, Business Casual Narwhal Moai. ]]-- |
|
|
| Report Abuse |
|
|
cxcharlie
|
  |
| Joined: 26 Aug 2009 |
| Total Posts: 1414 |
|
|
| 21 Dec 2013 11:32 AM |
| :DDDDDDDD THANK YOU SOO MUCH I'VE BEEN LOOKING 4'ever THANK YOU THANK YOU!!! |
|
|
| Report Abuse |
|
|