Advertisement
scriptingtales

Roblox IP Geolocation converter for Lua Sandbox

Mar 27th, 2024 (edited)
905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.64 KB | None | 0 0
  1. Part0 = Instance.new("Part")
  2. SurfaceGui1 = Instance.new("SurfaceGui")
  3. Frame2 = Instance.new("Frame")
  4. TextLabel3 = Instance.new("TextLabel")
  5.  
  6. TextLabel5 = Instance.new("TextLabel")
  7. TextBox6 = Instance.new("TextBox")
  8. TextLabel7 = Instance.new("TextLabel")
  9. TextButton8 = Instance.new("TextButton")
  10.  
  11.  
  12.    
  13.    
  14. Part0.Name = "IP"
  15. Part0.Parent = script
  16. Part0.CFrame = CFrame.new(0, 5.99999714, -32.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  17. Part0.Position = Vector3.new(0, 5.999997138977051, -32.5)
  18. Part0.Size = Vector3.new(18, 12, 1)
  19. Part0.Anchored = true
  20. Part0.BackSurface = Enum.SurfaceType.Studs
  21. Part0.BottomSurface = Enum.SurfaceType.Studs
  22. Part0.FrontSurface = Enum.SurfaceType.Studs
  23. Part0.LeftSurface = Enum.SurfaceType.Studs
  24. Part0.RightSurface = Enum.SurfaceType.Studs
  25. SurfaceGui1.Parent = Part0
  26. SurfaceGui1.ClipsDescendants = true
  27. SurfaceGui1.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  28. SurfaceGui1.Adornee = Part0
  29. Frame2.Parent = SurfaceGui1
  30. Frame2.Size = UDim2.new(0, 900, 0, 600)
  31. Frame2.Active = true
  32. Frame2.BackgroundColor = BrickColor.new("Institutional white")
  33. Frame2.BackgroundColor3 = Color3.new(1, 1, 1)
  34. Frame2.BorderColor = BrickColor.new("Institutional white")
  35. Frame2.BorderColor3 = Color3.new(1, 1, 1)
  36. Frame2.Draggable = true
  37. Frame2.Selectable = true
  38. TextLabel3.Name = "FrameLabel"
  39. TextLabel3.Parent = Frame2
  40. TextLabel3.Size = UDim2.new(0, 900, 0, 100)
  41. TextLabel3.BackgroundColor = BrickColor.new("Institutional white")
  42. TextLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
  43. TextLabel3.BorderColor = BrickColor.new("Institutional white")
  44. TextLabel3.BorderColor3 = Color3.new(1, 1, 1)
  45. TextLabel3.Font = Enum.Font.SourceSansLight
  46. TextLabel3.FontSize = Enum.FontSize.Size48
  47. TextLabel3.Text = "IP Geolocation Converter"
  48. TextLabel3.TextColor = BrickColor.new("Really black")
  49. TextLabel3.TextColor3 = Color3.new(0, 0, 0)
  50. TextLabel3.TextScaled = true
  51. TextLabel3.TextSize = 38
  52. TextLabel3.TextWrap = true
  53. TextLabel3.TextWrapped = true
  54.  
  55.  
  56.  
  57.  
  58. Frame2.Selectable = false
  59. Frame2.Active = false
  60. Frame2.Draggable = false
  61.  
  62.  
  63. if Frame2.Draggable == false and Frame2.Active == false and Frame2.Selectable == false then
  64.     print("Yes")
  65. else
  66.     print("No")
  67. end
  68.  
  69.  
  70.  
  71. TextLabel5.Name = "Credits"
  72. TextLabel5.Parent = Frame2
  73. TextLabel5.Position = UDim2.new(0, 650, 0, 550)
  74. TextLabel5.Size = UDim2.new(0, 250, 0, 50)
  75. TextLabel5.BackgroundColor = BrickColor.new("Institutional white")
  76. TextLabel5.BackgroundColor3 = Color3.new(1, 1, 1)
  77. TextLabel5.BorderColor = BrickColor.new("Institutional white")
  78. TextLabel5.BorderColor3 = Color3.new(1, 1, 1)
  79. TextLabel5.Font = Enum.Font.Unknown
  80. TextLabel5.FontSize = Enum.FontSize.Size48
  81. TextLabel5.Text = "Credits to: Kaiji#7888"
  82. TextLabel5.TextColor = BrickColor.new("Dark grey")
  83. TextLabel5.TextColor3 = Color3.new(0.407843, 0.411765, 0.411765)
  84. TextLabel5.TextScaled = true
  85. TextLabel5.TextSize = 38
  86. TextLabel5.TextWrap = true
  87. TextLabel5.TextWrapped = true
  88. TextBox6.Name = "IpInserter"
  89. TextBox6.Parent = Frame2
  90. TextBox6.Position = UDim2.new(0, 300, 0, 125)
  91. TextBox6.Size = UDim2.new(0, 300, 0, 75)
  92. TextBox6.BackgroundColor = BrickColor.new("Institutional white")
  93. TextBox6.BackgroundColor3 = Color3.new(1, 1, 1)
  94. TextBox6.BorderColor = BrickColor.new("Really black")
  95. TextBox6.BorderColor3 = Color3.new(0, 0, 0)
  96. TextBox6.BorderSizePixel = 0
  97. TextBox6.Font = Enum.Font.SourceSansLight
  98. TextBox6.FontSize = Enum.FontSize.Size14
  99. TextBox6.Text = ""
  100. TextBox6.TextColor = BrickColor.new("Really black")
  101. TextBox6.TextColor3 = Color3.new(0, 0, 0)
  102. TextBox6.TextScaled = true
  103. TextBox6.TextSize = 14
  104. TextBox6.TextWrap = true
  105. TextBox6.TextWrapped = true
  106. TextBox6.PlaceholderText = "Enter Ip Address..."
  107. TextLabel7.Name = "ShowLoc"
  108. TextLabel7.Parent = Frame2
  109. TextLabel7.Position = UDim2.new(0, 175, 0, 250)
  110. TextLabel7.Size = UDim2.new(0, 550, 0, 125)
  111. TextLabel7.BackgroundColor = BrickColor.new("Institutional white")
  112. TextLabel7.BackgroundColor3 = Color3.new(1, 1, 1)
  113. TextLabel7.BorderColor = BrickColor.new("Institutional white")
  114. TextLabel7.BorderColor3 = Color3.new(1, 1, 1)
  115. TextLabel7.Font = Enum.Font.SourceSansLight
  116. TextLabel7.FontSize = Enum.FontSize.Size48
  117. TextLabel7.Text = "Location will show here..."
  118. TextLabel7.TextColor = BrickColor.new("Really black")
  119. TextLabel7.TextColor3 = Color3.new(0, 0, 0)
  120. TextLabel7.TextScaled = true
  121. TextLabel7.TextSize = 38
  122. TextLabel7.TextWrap = true
  123. TextLabel7.TextWrapped = true
  124. TextButton8.Name = "DecodeIP"
  125. TextButton8.Parent = Frame2
  126. TextButton8.Position = UDim2.new(0.36500001, 0, 0.701666653, 0)
  127. TextButton8.Size = UDim2.new(0, 250, 0, 100)
  128. TextButton8.BackgroundColor = BrickColor.new("Silver flip/flop")
  129. TextButton8.BackgroundColor3 = Color3.new(0.533333, 0.533333, 0.533333)
  130. TextButton8.Font = Enum.Font.SourceSansLight
  131. TextButton8.FontSize = Enum.FontSize.Size14
  132. TextButton8.Text = "Get IP Geolocation"
  133. TextButton8.TextColor = BrickColor.new("Institutional white")
  134. TextButton8.TextColor3 = Color3.new(1, 1, 1)
  135. TextButton8.TextScaled = true
  136. TextButton8.TextSize = 14
  137. TextButton8.TextWrap = true
  138. TextButton8.TextWrapped = true
  139.  
  140.  
  141. RemoteEvent11 = Instance.new("RemoteEvent", owner.PlayerGui)
  142.  
  143. RemoteEvent11:FireClient(owner, TextBox6)
  144. RemoteEvent11.OnServerEvent:Connect(function(p, text)
  145.     TextBox6.Text = text
  146. end)
  147.  
  148.  
  149.  
  150. local function IpAd(ip)
  151.    
  152.    
  153.     local HttpService = game:GetService("HttpService")
  154.     local Success, ErrorMessage = pcall(function()
  155.         local Response = HttpService:GetAsync("http://ip-api.com/json/".. TextBox6.Text, true)
  156.         local Data = HttpService:JSONDecode(Response)
  157.         local Country= Data.country
  158.         local City = Data.city
  159.         local CountryRegion = Data.region    -- You can change "timezone" to "country" or "countryCode"
  160.  
  161.         if Data.status == "success" then
  162.             TextLabel7.Text = Country..", ".. City.. " in ".. CountryRegion.. " region" --- This tells the location
  163.             RemoteEvent11:FireAllClients(Country)
  164.         end
  165.        
  166.        
  167.         if not TextBox6.Text then
  168.             TextLabel7.Text = "No Location"
  169.         end
  170.        
  171.     end)
  172.    
  173.    
  174. end
  175.  
  176. TextButton8.MouseButton1Up:Connect(IpAd)
  177.  
  178. NLS([[
  179.  
  180. local remt = script.Parent.RemoteEvent
  181. remt.OnClientEvent:Connect(function(txt)
  182.     txt.InputChanged:Connect(function()
  183.         remt:FireServer(txt.Text)
  184.     end)
  185. end)
  186.  
  187. ]], owner.PlayerGui)
  188.  
  189. UICorner0 = Instance.new("UICorner")
  190. UICorner1 = Instance.new("UICorner")
  191. UIStroke0 = Instance.new("UIStroke")
  192.  
  193. if Part0.Position ~= Vector3.new(0, 6, 22.5) then
  194.     Part0.Position = Vector3.new(0, 6, 22.5)
  195. end
  196.  
  197. TextLabel5.FontFace.Style = Enum.FontStyle.Italic
  198. TextLabel5.FontFace.Weight = Enum.FontWeight.Light
  199.  
  200. UICorner0.Parent = TextBox6
  201. UIStroke0.Parent = TextBox6
  202. UIStroke0.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  203. UICorner1.Parent = TextButton8
  204. SurfaceGui1.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement