jepale
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 255 |
|
|
| 22 Feb 2014 02:07 PM |
| I came back this morning, and roblox my have updated or soemthing, now my tycoon does not work. And I find this error in studio. "Workspace.Roblox Tycoon.Factory.Buy Drop1 - 100.Head.Script:9: attempt to index global 'model2' (a nil value)" And yes, I tried going back to previous versions of the games. 20 robux reward for fixing it. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 02:09 PM |
... How about you give a SCRIPT, perhaps? We can't fix it if you don't show us what we have to. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 02:10 PM |
a global value is wrong (_G)
Make sure everything using that variable has _G |
|
|
| Report Abuse |
|
|
jepale
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 255 |
|
|
| 22 Feb 2014 02:11 PM |
| Ok, Ill go get the script! sorry |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 02:11 PM |
| Apologies for unnecessary harshness. |
|
|
| Report Abuse |
|
|
jepale
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 255 |
|
|
| 22 Feb 2014 02:12 PM |
wait(0.01) ------------------------------------------------------------------------------------------------------------------------- model = script.Parent.Parent.Drop1 Upgradecost = 100 ------------------------------------------------------------------------------------------------------------------------- upgradeStuff = model:clone() wait(0.1) model:remove() model2:remove() owner = script.Parent.Parent.Parent.OwnerName local ting = 0 function onTouched(hit) if ting == 0 then ting = 1 check = hit.Parent:FindFirstChild("Humanoid") if check ~= nil then if hit.Parent.Name == owner.Value then local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Cash") if cash.Value > (Upgradecost-1) then cash.Value = cash.Value - Upgradecost upgradeStuff.Parent = script.Parent.Parent.Parent script.Parent.Parent:remove() end end end end ting = 0 end end script.Parent.Touched:connect(onTouched) there it is |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 02:13 PM |
You don't define model2..
#nerdsunited |
|
|
| Report Abuse |
|
|
| |
|
jepale
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 255 |
|
|
| 22 Feb 2014 02:14 PM |
| OMG THANK YOU. I'll see if that works |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 02:14 PM |
For some reason it seems model2 is not defined....unless it is global if so, do
_G.model2 for everywhere u put model2 |
|
|
| Report Abuse |
|
|
jepale
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 255 |
|
|
| 22 Feb 2014 02:18 PM |
| Guys, it worked! thanks so much. I spent months on this game, And I thought that It broke out of nowhere, I forgot that I was modifying the scripts, I must have broke them when I was doing it. |
|
|
| Report Abuse |
|
|