im trying to spawn peds in the stores with script that should be working
my client.lua code
Citizen.CreateThread(function()
--load into memory
local Hash = GetHashKey( "mp_m_shopkeep_01" )
if not HasModelLoaded( Hash ) then
RequestModel( Hash )
Wait(20)
end
--spawning npcs
local Ped = CreatePed(4, Hash, -1485.89, -377.61, 40.1643, 0.0, true, true)
SetBlockingOfNonTemporaryEvents(ped, true)
SetPedCombatAttributes(ped, 46, true)
SetPedFleeAttributes(ped, 0, 0)
end
any help to why its not working?
1 Like
Have you find an explication ?
local hash = GetHashKey( "mp_m_shopkeep_01" )
while not HasModelLoaded( hash ) do
RequestModel( hash )
Wait(20)
end
local pos = GetEntityCoords(GetPlayerPed(-1))
local ped = CreatePed(4, hash, pos.x, pos.y, pos.z+1, 0.0, true, true)
SetBlockingOfNonTemporaryEvents(ped, true)
SetPedCombatAttributes(ped, 46, true)
SetPedFleeAttributes(ped, 0, 0)
The lua interpreter is case sensitive.
local dog = "Benjamin"
local Dog = "Samba"
local DOG = "Bernie"
print ("The dogs are named " .. dog .. ", " .. Dog .. ", and " .. DOG)
https://en.wikibooks.org/wiki/Lua_Programming/case_sensitivity
@Favkis_Nexerade
Hello I’m looking for a mod or code to spawnear peds to be able to put them on the map and be able to make clips like in the player mode
Ok, now I’m not able to spawn peds too. Looks like R* broke something in last update.
UPD: Nevermind, my problem is most likely related to R* voodoo networking, not to spawning itself.