Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HttpService = game:GetService("HttpService")
- local apiKey = "dc437a851815d0fc93f0488ae201dc06" -- Твой API ключ
- local city = "Gomel" -- Название города
- local country = "BY" -- Код страны
- local function updateTemperature()
- local url = "http://api.weatherapi.com/v1/current.json?key="..apiKey .."&q="..city..""..country.."&aqi=no"
- local response
- pcall(function()
- response = HttpService:JSONDecode(game:HttpGetAsync(url))
- end)
- if response then
- local temperature = response.main.temp
- print("Температура: " .. tostring(temperature) .. "°C")
- else
- print("Не удалось получить данные о погоде")
- end
- end
- updateTemperature()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement