Advertisement
scriptingtales

啊齉

Jun 29th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. -- Gui to Lua
  2. -- Version: 3.2
  3.  
  4. -- Instances:
  5.  
  6. local ScreenGui = Instance.new("ScreenGui")
  7. local TextLocationLabel = Instance.new("TextLabel")
  8.  
  9. --Properties:
  10.  
  11. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  12. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  13.  
  14. TextLocationLabel.Name = "TextLocationLabel"
  15. TextLocationLabel.Parent = ScreenGui
  16. TextLocationLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  17. TextLocationLabel.BackgroundTransparency = 1.000
  18. TextLocationLabel.Position = UDim2.new(0.0163090136, 0, 0.0674763843, 0)
  19. TextLocationLabel.Size = UDim2.new(0, 200, 0, 50)
  20. TextLocationLabel.Font = Enum.Font.SourceSans
  21. TextLocationLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  22. TextLocationLabel.TextScaled = true
  23. TextLocationLabel.TextSize = 14.000
  24. TextLocationLabel.TextWrapped = true
  25.  
  26. -- Scripts:
  27.  
  28. local function DBCWCXF_fake_script() -- TextLocationLabel.Ch]s
  29. local script = Instance.new('LocalScript', TextLocationLabel)
  30.  
  31. game.Players.PlayerAdded:Connect(function()
  32. --Made by Collin201/rnelee/Big7Rich
  33. Instance.new("RemoteEvent", game.ReplicatedStorage)
  34.  
  35. local TextLoc = script.Parent
  36. local HttpService = game:GetService("HttpService")
  37. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  38.  
  39.  
  40.  
  41.  
  42.  
  43. local ServerUpdate = ReplicatedStorage.RemoteEvent
  44.  
  45. local Success, ErrorMessage = pcall(function()
  46. local Response = HttpService:GetAsync("http://ip-api.com/json/", true)
  47. local Data = HttpService:JSONDecode(Response)
  48. local Country= Data.country
  49. local City = Data.city
  50. local CountryCode = Data.countryCode -- You can change "timezone" to "country" or "countryCode"
  51.  
  52. if Data.status == "success" then
  53. game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLocationLabel.Text = "Server Region: ".. City.. ", ".. Country --- This tells the location
  54. ServerUpdate:FireAllClients(Country)
  55. end
  56. end)
  57.  
  58. if not Success then
  59. warn("There was an error retrieving server location")
  60. warn(ErrorMessage)
  61. end
  62. end)
  63. end
  64. coroutine.wrap(DBCWCXF_fake_script)()
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement