I have the following script:

if game.ServerStorage.Local.Value == false then
	print('Server IP: WAN')
	bux = game:GetService("HttpService"):GetAsync("http://tcserver.raspctl.com/tc/r/1000/7.txt", true)
	tix = game:GetService("HttpService"):GetAsync("http://tcserver.raspctl.com/tc/t/1000/7.txt", true)
else
	print('Server IP: LAN')
	bux = game:GetService("HttpService"):GetAsync("http://10.0.0.21/tc/r/1000/7.txt", true)
	tix = game:GetService("HttpService"):GetAsync("http://10.0.0.21/tc/t/1000/7.txt", true)
end

This checks a BoolValue named Local, and if it is set to True, then it uses my server's LAN IP, and it if it set to False, then it uses my server's WAN IP.

This works fine, but I want to know if I can get the game's IP, so if the game's IP is my IP, then use the server's LAN IP, and if the game's IP is not my IP, then use the server's WAN IP.

So how would I get the game's IP address?

2 comments

0

Getting the game's IP address isn't a thing.

0

@1waffle1 Cri cri. But I now realize that it is a thing. I might post an answer later, but I can send a POST to a server, and have that server return the IP of the sender. It is probably too complicated for what can be solved with a boolValue but I might try anyway.