Eof expectet near end

I am making some codes and when i am going to put an end after the function it says:

this is the code:
image

i have checked the other topics about this but it dosent help

Hello, you have an extra end at the end :+1:,
Sincerely, Azeroth

ye i put that there beacuse i need to end the function, otherwise the rest of the functions wont work

Tries GetPlayerPed(-1) instead of PlayerPed(),
Sincerely, Azeroth

You also have a problem with the second line is entity instead of Enity,
Sincerely, Azeroth

now i have a error here, at the “end”

RegisterCommand(“id”, function()
TriggerEvent(“chatMessage”, “Kvicksund’s Kommun”, {255, 230, 0},GetPlayerFromServerId(indextogive))
end, false),
Sincerely, Azeroth

thanks now that is fixed.
now its back at the first rows again.
I need to somehow stop the function in order to make every other functions work.

image

You have one indentation too many.

@Mannen69

Are you trying to add more functionality to onStartup()? If so, there’s no need for an end at that position. Do this:

function onStartup()
    local player_ped = PlayerPedId()
    
    SetPedMaxHealth(player_ped, 50)
    SetEntityHealth(player_ped, 50)
    CancelCurrentPoliceReport()
    SetWeaponDamageMultiplier(GetHashKey("WEAPON_UNARMED"), 0.5)
    SetPlayerCanDoDriveBy(player_ped, false)
    SetPedCanBeShotInVehicle(player_ped, false)
    CanKnockPedOffVehicle(player_ped, true)

    -- Continue any other code here, don't add another 'end' anywhere unless needed
end