Problem beim NPC Script

1 Beiträge · 2.010 Aufrufe
19.07.2020, 20:47 #1

Hi,


Ich hab ein NPC System gebastelt, aber es wird kein NPC an dieser Coord gespawnt.

ich bin solangsam echt am verzweifeln könnte mir evtl einer helfen bitte.


server/main.lua
ESX = nil

local PEDS = nil
RegisterNetEvent("PEDS")
AddEventHandler("PEDS",function(NPC)

	local LocationNPC = NPC.Pos
	local heading = NPC.Heading
	RequestModel(GetHashKey(NPC.PEDS))

	while not HasModelLoaded(GetHashKey(NPC.PEDS)) do
		Citizen.Wait(100)	
	end

	PEDS = CreatePed(7,GetHashKey(NPC.PEDS),LocationNPC.x,LocationNPC.y,LocationNPC.z-1,heading,0,true,true)	
	FreezeEntityPosition(PEDS,true)
	SetBlockingOfNonTemporaryEvents(PEDS, true)	
	--TaskStartScenarioInPlace(PEDS, "WORLD_HUMAN_AA_SMOKE", 0, false)
	SetEntityInvincible(PEDS,true)
end)
client/main.lua
ESX = nil

local PEDS = nil
RegisterNetEvent("PEDS")
AddEventHandler("PEDS",function(NPC)

	local LocationNPC = NPC.Pos
	local heading = NPC.Heading
	RequestModel(GetHashKey(NPC.PEDS))

	while not HasModelLoaded(GetHashKey(NPC.PEDS)) do
		Citizen.Wait(100)	
	end

	PEDS = CreatePed(7,GetHashKey(NPC.PEDS),LocationNPC.x,LocationNPC.y,LocationNPC.z-1,heading,0,true,true)	
	FreezeEntityPosition(PEDS,true)
	SetBlockingOfNonTemporaryEvents(PEDS, true)	
	--TaskStartScenarioInPlace(PEDS, "WORLD_HUMAN_AA_SMOKE", 0, false)
	SetEntityInvincible(PEDS,true)
end)
config.lua
Config = {}


-- ## MISSION NPC PART ## --



-- Location where get mission from NPC:

Config.PEDS = {

	{

		Pos = {x=3311.26,y=5176.45,z=19.61},		-- set NPC coords here

		Heading = 231.39,							-- set heading of the NPC here

		Ped = 's_m_y_dealer_01'						-- set npc model name here

	},

}
__resource.lua
client_scripts {
	'client/main.lua',	
}

server_scripts {
	'server/main.lua',
}


Grüße,

Melde dich an, um zu antworten.
© 2026 GTA-FIVEM.ORGImpressumDatenschutzNutzungsbedingungenCookiesShimo Forum