I have a problem with remove ped command

hey everyone ! i have a script of a pet shop but when someone kills the dogs (see photo)
they are just laying down i tried to make a command (credit Loshido) that removed them
but when im typing the command in chat its doing this:


the sciprt:

*RegisterCommand(‘cleardogs’, function()

  • local source = source

  • local c,peds = GetEntityCoords(GetPlayerPed(source)),GetAllPeds()

  • for k,v in pairs()do

  •    local p = GetEntityCoords(v)
    
  •    if #(c-p) < 25.0 then
    
  •        local model = GetEntityModel(v)
    
  •        if model == GetHashKey('a_c_chop') or GetHashKey('a_c_coyote') or GetHashKey('a_c_husky') or GetHashKey('a_c_retriever') or GetHashKey('a_c_rottweiler') or GetHashKey('a_c_shepherd') then
    
  •            DeleteEntity(v)
    
  •        end
    
  •    end
    
  • end

*end, false)