Declared in another script:
_G.Stamina = 100
The script that uses it and says "comparing number to nil"
local SBar = script.Parent:WaitForChild("BackG"):WaitForChild("SBar")
while _G.Stamina > 0 and wait(.1) do
print "test"
SBar:TweenSize(UDim2.new(0, _G.Stamina/100, 0, 1, 0), "Out", "Quint", .1, true)
end
while true and wait(.1) do
wait(.1)
local print = "s"
end
Is this a bug or am I doing something wrong here?

2 comments
You can't get
_Gvariables in a LocalScript if you're using one, or it might be the case of that the script loaded before the variable, in which case you'd dowhile not _G.Stamina do wait(1/8) endhttp://wiki.roblox.com/index.php?title=Function_Dump/Core_Functions#G