Skip to content

Commit

Permalink
V1.4
Browse files Browse the repository at this point in the history
added animations and scenarios
  • Loading branch information
justSalkin authored Jan 27, 2024
1 parent 10f660b commit ad09bd4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@ function StartNPCs() --start function after user selected the character
Wait(1000)
FreezeEntityPosition(npc, true) -- NPC can't escape
SetBlockingOfNonTemporaryEvents(npc, true) -- NPC can't be scared
--create blip
if v.blip ~= 0 then
if v.blip ~= 0 then --create blip
local blip = Citizen.InvokeNative(0x554D9D53F696D002, 1664425300, x, y, z)
SetBlipSprite(blip, v.blip, true)
Citizen.InvokeNative(0x9CB1A1623062F402, blip, v.npc_name)
end
if v.scenario then --load scenario in loop
TaskStartScenarioInPlace(npc, GetHashKey(v.scenario), 0, true, false, false, false)
end
if v.anim.animDict and v.anim.animName then --loads animation looped
RequestAnimDict(v.anim.animDict)
while not HasAnimDictLoaded(v.anim.animDict) do --get animation
Citizen.Wait(100)
end
TaskPlayAnim(npc, v.anim.animDict, v.anim.animName, 1.0, -1.0, -1, 1, 0, true, 0, false, 0, false)
end
end
end

Expand Down Expand Up @@ -196,4 +205,4 @@ AddEventHandler("juSa_npc_rewards:infoexchangesend", function(takeitem, giveitem
local type = "exchange"
TriggerServerEvent("juSa_npc_rewards:discord", type, giveitem, takeitem, givemoney, takemoney)
end
end)
end)

0 comments on commit ad09bd4

Please sign in to comment.