Im a noob HALP

help

#1

Alright, I know there will be 100 errors in this, but I’m open for everything. Let me know what’s wrong with this, and what is just plain dumb. This is my first attempt at a script in LUA, and it’s function is to announce that someone is attempting to steal a vehicle, and give the vehicle description and location.

AddEventHandler('vehicleTheft', function()

local ped = GetPlayerPed( -1 )

	if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then

		pedLoc = local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1),true))


		if IsPedTryingToEnterALockedVehicle(GetPlayerPed(-1)) then

			TriggerEvent("chatMessage", "", { 0, 0, 0 }, "Player is attempting to steal a " + GetEntityModel(vehicle) + "nearby" + pedLoc )


		end


	end

end)