generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: my ENTIRE game broke because of one simple thing.

Previous Thread :: Next Thread 
jepale is online. 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
WillScriptForFood is not online. WillScriptForFood
Joined: 03 Aug 2013
Total Posts: 701
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 is not online. 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 is online. jepale
Joined: 24 Aug 2008
Total Posts: 255
22 Feb 2014 02:11 PM
Ok, Ill go get the script! sorry
Report Abuse
WillScriptForFood is not online. WillScriptForFood
Joined: 03 Aug 2013
Total Posts: 701
22 Feb 2014 02:11 PM
Apologies for unnecessary harshness.
Report Abuse
jepale is online. 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
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
22 Feb 2014 02:13 PM
You don't define model2..

#nerdsunited
Report Abuse
WillScriptForFood is not online. WillScriptForFood
Joined: 03 Aug 2013
Total Posts: 701
22 Feb 2014 02:13 PM
model2 wasn't defined.
Report Abuse
jepale is online. 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 is not online. 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 is online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image