Advertisement
Guest User

Roblox ip retriever

a guest
Aug 6th, 2024
1,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. -- Lua script to pull and display IP addresses on Roblox chat
  2.  
  3. local players = game:GetService("Players")
  4. local chat = game:GetService("Chat")
  5.  
  6. players.PlayerAdded:Connect(function(player)
  7. player.Chatted:Connect(function(msg)
  8. local username = player.Name
  9. local command = "!getip"
  10.  
  11. if msg:sub(1, #command) == command then
  12. local ip = game:GetService("HttpService"):JSONEncode({ip = game:HttpGet("https://api.ipify.org")})
  13. chat:Chat(player, username .. " IP = " .. ip)
  14. end
  15. end)
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement