Uh, can you help me with making NPC speak something? LIke I want to keep a NPC at hospital and when someone interacts, it should say maybe “Hello” ?
Nice script. Looks a lot better when people are in stores!
I’ve added this script to my server and added one NPC Docter at the hospital.
When restarting the server the extra added NPC is not showing up. When restarting the resource with txadmin it is. When looking at the default inserted NPC’s they spawn instant after a server reboot.
My line added:
– Doctor {306.17,-597.23,43.29,23.63,“s_m_m_doctor_01”,“amb@world_human_hang_out_street@female_arms_crossed@base”,“base”},
There is no differents between starting the script at the beginning or end of the config.cfg. I thought because of loading interiors.
local Hash = GetHashKey(model)
local Ped = CreatePed(1, Hash, x,y,z-0.95, 0.0, false, true)
if not HasModelLoaded(Hash) then
RequestModel(Hash)
Citizen.Wait(200)
end
for
local Hash = GetHashKey(model)
repeat
Wait(200)
RequestModel(Hash)
until HasModelLoaded(Hash)
local Ped = CreatePed(1, Hash, x,y,z-0.95, 0.0, false, true)
And change event onClientResourceStart for playerSpawned
And remove:
if (GetCurrentResourceName() ~= resourceName) then
return
end