Luck_weathersync - Reallife weather sync for FiveM (Added Realtime Clock)

This resource has been broken for a little bit. I’m not sure what is going on with the API, as when you access the link directly in a browser it will display the json information correctly, however when trying to print the resultData in the script it keeps coming back as nil with an errorCode of 0, it returns a table for resultHeaders, but it will not print the table for some unknown reason. It’s a shame too, but I think the API itself is blocking the requests now as I can use the openweathermap.com API and it will actually return the request properly.

Only problem is that the openweathermap.com api does not return the same information as weatherapi.com so there needs to be an overhaul on the entire script to get the weather to sync correctly using the openweathermap.com API.

hey i realy like your script but i have a little problem :confused:
the script starts normal without problems but if i am in game for example at 11pm it is not night, so its every time daytime :confused:
what can i do that its day and night same as reallife …

Thanks a lot

I will share code, you can wait.

You can download from here!

The latest version shows this error in console: SCRIPT ERROR: @luck-weathersync/server.lua:26: attempt to index a nil value

Are you set api key?

SCRIPT ERROR: @weathersync/client.lua:254: attempt to index a nill value (field ?)

How to fix?

@goodluckgod The wind sound is over powering near gates and fences

is there actually a fix for the error attempt to index a nil value ???

Can you print weatherTypee on event and post it?

SCRIPT ERROR: @weathersync/client.lua:254: attempt to index a nill value (field ?)

that’s just the error why the script doesn’t really run

1 Like

Because the api add the new types of weather, i was add all of weather types, i will update it soon.

I look the api doc and nothing changed, do you paste your api key to server config? If you paste just type print(weatherTypee) on top of weatherType = weatherTypes[weatherTypee].type and share the result with me please.

So I did that with the print now the error message is missing and the message is shown script: weathersync 1003

Edit: ok now the error appears again and gets the number 1009

Can you change client with this?

yes I can do it and then see if everything works?

There is the same number for two different weather types.

[1150] = {
type = “FOGGY”,
rain = -1,
},

[1150] = {
type = “RAIN”,
rain = 0.2,
},

hello so I was wondering will this interfer with vmenu weather and time?
Edit: just realized it includes irl time of the city

Hello, the script works great, but there is a problem. after i start the resource and join in the game Mouse movement dont work (camera move). how i can fix that?

I do not use any kind of nui or camera thing, it’s impossible.