|
| 09 Feb 2013 07:23 PM |
if hit.Name:match("%d+") and hit.Name:match("tree")then print("chop") local a = tonumber(hit.Name:match("%d+")) local b = a + 1 hit.Name = b.." tree" print(hit.Name, a) hit.Size = Vector3.name(hit.Size.x - a*0.05,hit.Size.y,hit.Size.z - a*0.05)--error line end
for some reason i'm getting this error: attempt to call field 'name' (a nil value) however print(hit.Name, a) results in: 1 tree 1 which is exactly what it should print... any ideas why?
oh and 'hit' is what is returned by the touched event, this is just part of the script. |
|
|
| Report Abuse |
|
|
MrBlu3
|
  |
| Joined: 26 May 2012 |
| Total Posts: 37 |
|
|
| 09 Feb 2013 07:39 PM |
| Vector3 has a 'name' property? |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2013 07:39 PM |
| Name should be the person making contact. Try: hit.Parent |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2013 07:40 PM |
EDIT:
Actually scratch my say. I honestly have no idea what Name is being addressed as. |
|
|
| Report Abuse |
|
|
ashispro
|
  |
| Joined: 14 Sep 2008 |
| Total Posts: 452 |
|
|
| 09 Feb 2013 07:45 PM |
| I think you mean 'new' not 'name' |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2013 07:47 PM |
hit.Size = Vector3.name(hit.Size.x - a*0.05,hit.Size.y,hit.Size.z - a*0.05)
You put Vector3.name... |
|
|
| Report Abuse |
|
|
|
| 09 Feb 2013 08:20 PM |
| I feel stupid for not noticing that, totally derped... thanks for pointing that out XD |
|
|
| Report Abuse |
|
|