It's not returning anything, because it is trying to output theIP before it gets a response from getServerIp.
You should do what TAPL said, and just define theIP at the top of the script, because it isn't going to change.
addEventHandler ( "onResourceStart", resourceRoot, function ( )
theIP = getServerIp()
end )
addCommandHandler("getip", function()
outputChatBox(theIP)
end )
function getServerIp()
callRemote("http://www.nub.hj.cx/getServerIp.php", function(value)
if (value ~= "ERROR") then
outputChatBox("Returning value...")
return value
end
end )
outputChatBox("Returning False...")
return false
end