Script error, pls help

Hi. I seem to always post about my errors but if I can’t fix it I hope and I am sure someone else can.

I have a script error. It comes every time a player is joining the server.

And it looks like this:
Udklip2

And the part where the error is, looks like this:
Udklip

Hopefully, someone can help me with this.

I also have another error. When players join my server, you can’t see their ingame names.

I think this is the error code:
Udklip3

The script part where the error is, looks like this:
Udklip4

I hope that someone of you can help me I really want those errors gone.

Those two errors are unrelated to each other.

The first error is because you’re not checking if data.hunger is nil or not a number, and you’re comparing it to a number though it’s nil.

The second error is an error which has been fixed in the latest cfx-server-data commit.

So if i want to fix the second error, i just need to replace the script part in the photo with allof this:

    names[source] = { name = GetPlayerName(source), id = source }

    TriggerClientEvent('rlUpdateNames', GetHostId())
	if GetHostId() then
		TriggerClientEvent('rlUpdateNames', GetHostId())
	end
end)

RegisterServerEvent('rlUpdateNamesResult')

???

Replace TriggerClientEvent('rlUpdateNames', GetHostId()) with:

if GetHostId() then
    TriggerClientEvent('rlUpdateNames', GetHostId())
end

… or just git pull

And to fix the first error i need to do what?
Sorry for me asking so much. But I am fairly new to coding and server development and I have to learn some how :slight_smile:

Well some how both errors are gone now. But after i have installed oneSync the playerlist still doesn’t show?

if data and tonumber(data.hunger) and tonumber(variation) then
    local was_starving = data.hunger >= 100
    data.hunger = data.hunger + variation
    local is_starving = data.hunger >= 100

or so.

Yea, not gonna help you read.

Okay but thank you very much :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.