it is a random generated numbers by math.random()
I make this because I want every player has their ip different from each other
Probably a bit unrelated, but:
They arenāt using real ips, (and tbh tracking the users ip in game would probably be illegal / against TOS)
Replace
if typescript.Text == "ipconfig/view" then
local Code = ipvalue
game.ReplicatedStorage.CMD:FireServer(Code,outputtext)
end
with
if typescript.Text == "ipconfig/view" then
local Code = "print("..ipvalue..")"
game.ReplicatedStorage.CMD:FireServer(Code,outputtext)
end
Iām using that response to criticize the realism, but itās just a roblox game after all. Thereās no such thing as ipconfig /view.
Yeah. I make a game like windows computer. And I want to make it very realistic like windows by making custom ip in game. The ip isnāt their real ip, like I said before it is just a random generated number by math.random()
yeah, thatās because ipconfig/view is a custom command for my game. It is not an actual cmd command
this is what it prints
Oh there is a typo. Replace it with this then please:
if typescript.Text == "ipconfig/view" then
local Code = "print(\""..ipvalue.."\")"
game.ReplicatedStorage.CMD:FireServer(Code,outputtext)
end
thatās it! I appreciate your effort helping me. Thank you so much!
The IPConfig command only shows the local IP address, why not randomize it with 192.168.0.0-255 (192.168.0.0/24)? You really canāt see your public IP address on the command prompt without contacting external devices (Invoking webrequests on the powershell, or using nslookup).
(Again, Iām expanding upon this because of your mention of realism. Itās your choice lol)
Wait, do you want the output to be JUST the IP? If so I think I know how to make it work
yeah I think so, that would be good!
Replace this:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr, Code,outputtext)
pcall(function()
local suc,err = loadstring(Code)
if suc then
loadstring(Code)()
outputtext.Text = Code
else
warn("ERROR")
end
end)
end)
with:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr, Code,outputtext)
pcall(function()
local suc,err = loadstring(Code)
if suc then
loadstring(Code)()
Code = "print(\""..Code.."\")"
outputtext.Text = Code
else
warn("ERROR")
end
end)
end)
AND
if typescript.Text == "ipconfig/view" then
local Code = "print(\""..ipvalue.."\")"
game.ReplicatedStorage.CMD:FireServer(Code,outputtext)
end
back to
if typescript.Text == "ipconfig/view" then
local Code = ipvalue.
game.ReplicatedStorage.CMD:FireServer(Code,outputtext)
end
it gives this warn.
also, is this dot a typo?
yea, that dot is typo. Remove it please xD
also do this again please _______
we got this warn again
To anyone returning in the future, the final code was:
Server script
game.ReplicatedStorage.CMD.OnServerEvent:Connect(function(plr, Code, outputtext)
pcall(function()
outputtext.Text = Code
Code = "print(\""..Code.."\")"
loadstring(Code)()
end)
end)
Local script
local run = script.Parent
local typescript = run.Parent.ScrollingFrame.TextBox
local outputtext = run.Parent.Output
local ip = game:GetService("Players").LocalPlayer:WaitForChild("Data"):WaitForChild("IP")
local ipvalue = ip.Value
run.MouseButton1Click:Connect(function()
wait(2)
if typescript.Text == "ipconfig/view" then
local Code = ipvalue
game.ReplicatedStorage.CMD:FireServer(Code,outputtext)
end
end)