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: ATTEMPT TO FREAKING CALL A NIL VALUE

Previous Thread :: Next Thread 
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 05:51 PM
As you may know, the title lists the world's most annoying error message known to scripting history. With luck, I was able to find the SCRIPT and the LINE it was on, as by it's nature, won't tell you either. Unfortunately, I'm not able to distinguish the nil value within the line.

elseif _G.PLAYER_CHECK(BrickColor.new 'Really blue') <= 1 and not gamerunning and Workspace:FindFirstChild('Message') then

Some things that need to be explained:

_G.PLAYER_CHECK(BrickColor.new 'Really blue') <= 1 corresponds to
_G["PLAYER_CHECK"] = function (color)
local PLAYER_COUNT = 0
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor.Name == color.Name then
PLAYER_COUNT = PLAYER_COUNT + 1
end
end
return PLAYER_COUNT
end

not gamerunning corresponds to gamerunning = script.Parent.Mainframe.GameRunning.Value -- a boolean value

and Workspace:FindFirstChild ('Message') is a given.
Report Abuse
DevDerp is not online. DevDerp
Joined: 25 Jan 2009
Total Posts: 1000
04 Mar 2014 05:53 PM
Tells us hes calling a nil value in a line he wont share with us? What a sham, we cant help you buddy if we dont know whats being declared as nil.
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
04 Mar 2014 05:53 PM
Gross mess
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 05:55 PM
@Dev,

ehem:
elseif _G.PLAYER_CHECK(BrickColor.new 'Really blue') <= 1 and not gamerunning and Workspace:FindFirstChild('Message') then

So, I actually did

@yum, that's just not helping.
Report Abuse
DevDerp is not online. DevDerp
Joined: 25 Jan 2009
Total Posts: 1000
04 Mar 2014 05:57 PM
the problem could be the fact that you called a Global variable/function without making sure that it even existed in the first place. in which case you can do something like:

repeat wait() until _G['PLAYER_CHECK']~=nil
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 05:57 PM
Would I still need to do that if I defined it in that same script?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
04 Mar 2014 05:58 PM
Ummmm how did you manage to find it... And also I recommend doing

gamerunning = script.Parent.Mainframe.GameRunning

and in the if section

and not (gamerunning.Value) and
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 06:01 PM
Thanks, I'll try that.

What do you mean by "find it"?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
04 Mar 2014 06:02 PM
Find the nil line.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 06:03 PM
Commented out the line I thought would error. No more error. That's what I've concluded.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 06:20 PM
These are hard, I know. Please just give your best guess!
Report Abuse
dave2011 is not online. dave2011
Joined: 02 Oct 2010
Total Posts: 10581
04 Mar 2014 06:28 PM
the only thing that could cause it is something wrong with your global variable, make sure its spelled correctly and everything
Report Abuse
StackEnd is not online. StackEnd
Joined: 20 Oct 2008
Total Posts: 672
04 Mar 2014 06:31 PM
Well...

_G["PLAYER_CHECK"] = function (color)

Either I'm missing something here, or this should be 'function color()' and not 'function (color)'
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
04 Mar 2014 06:40 PM
@Stack, color is a parameter, and PLAYER_CHECK is the name.
Report Abuse
StackEnd is not online. StackEnd
Joined: 20 Oct 2008
Total Posts: 672
04 Mar 2014 06:45 PM
Instead of:

if v.TeamColor.Name == color.Name then

Try:

if v.TeamColor == color then
Report Abuse
StackEnd is not online. StackEnd
Joined: 20 Oct 2008
Total Posts: 672
04 Mar 2014 06:46 PM
I'm pretty sure "Name" is not a valid property of the property TeamColor
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
04 Mar 2014 07:38 PM
it is.
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