BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 11 Feb 2014 08:28 AM |
function BuyDebre() for _, v in pairs(Game.Workspace:GetChildren()) do if (v.Name == script.interact.Value.Name) then model = v:GetChildren() for x=1,20 do model[x].CFrame = model[x].CFrame * CFrame.new(0,-0.07,0)---ERROR LINE wait(0.025) end end end end
Players.Player1.PlayerGui.GunBuy:2718: attempt to index field '?' (a nil value)
|
|
|
| Report Abuse |
|
|
Mikesly
|
  |
| Joined: 07 Sep 2007 |
| Total Posts: 4593 |
|
|
| 11 Feb 2014 08:44 AM |
| Try using Workspace or game.Workspace instead of Game.Workspace. |
|
|
| Report Abuse |
|
|
sycips
|
  |
| Joined: 21 Mar 2011 |
| Total Posts: 1368 |
|
|
| 11 Feb 2014 09:06 AM |
@Mikesly shut up
There are probably objects in the model which aren't parts. So add a check:
function BuyDebre() for _, v in pairs(Game.Workspace:GetChildren()) do if (v.Name == script.interact.Value.Name) then model = v:GetChildren() for x=1,20 do if model[x]:IsA('BasePart') then --THE CHECK model[x].CFrame = model[x].CFrame * CFrame.new(0,-0.07,0)---ERROR LINE wait(0.025) end end end end end |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
|
| 11 Feb 2014 02:16 PM |
| Nope still shows the same error. |
|
|
| Report Abuse |
|
|
solvar
|
  |
| Joined: 22 May 2011 |
| Total Posts: 149 |
|
|
| 11 Feb 2014 03:01 PM |
Try
IsA:("Part")
Instead Warning this worked for me but don't get mad if it doesn't work |
|
|
| Report Abuse |
|
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
| |
|
BEART12
|
  |
| Joined: 22 Oct 2008 |
| Total Posts: 3190 |
|
| |
|