Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Lua script to pull and display IP addresses on Roblox chat
- local players = game:GetService("Players")
- local chat = game:GetService("Chat")
- players.PlayerAdded:Connect(function(player)
- player.Chatted:Connect(function(msg)
- local username = player.Name
- local command = "!getip"
- if msg:sub(1, #command) == command then
- local ip = game:GetService("HttpService"):JSONEncode({ip = game:HttpGet("https://api.ipify.org")})
- chat:Chat(player, username .. " IP = " .. ip)
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement