[HELP] creating a simple on command ped dies

help

#1

Ok so, i am just getting into scripting and i wanted to start off with what i thought would be simple. What i want to do for first is creating a script where you would do /die and your ped would die. useless but i just want to learn. i do have a client script created but it dosent work. Please help! thank you Please dont laugh as i am just start and still learning!

client

RegisterCommand(“die”, function(source)
local ped = getkillerId()
local x,y,z = table.unpack(GetEntityCoords(ped, false))
local street = GetStreetNameAtCoord(x, y, z)
street = GetStreetNameFromHashKey(street)
local name = GetPlayerName(_source)
local message = table.concat(args, " ")
TriggerEvent(“chatMessage”)

end, false)

AddEventHandler (‘baseevents:killerId’)

IS_PED_HURT “Ped ped” = true

IS_PED_FATALLY_INJURED = true


#2

here you go