Skip to content

Instantly share code, notes, and snippets.

@FrazzIe
Created July 21, 2019 06:19
Show Gist options
  • Select an option

  • Save FrazzIe/b6cf0690de89fcaf48d396dcb5c2d92a to your computer and use it in GitHub Desktop.

Select an option

Save FrazzIe/b6cf0690de89fcaf48d396dcb5c2d92a to your computer and use it in GitHub Desktop.
Syringe Animation - FiveM (Weird)
local syringeProp = `prop_syringe_01`
local syringeDict = "rcmpaparazzo1ig_4"
local syringeAnim = "miranda_shooting_up"
local syringeBone = 28422
local syringeOffset = vector3(0, 0, 0)
local syringeRot = vector3(0, 0, 0)
function UseSyringe()
RequestAnimDict(syringeDict)
while not HasAnimDictLoaded(syringeDict) do
Citizen.Wait(150)
end
RequestModel(syringeProp)
while not HasModelLoaded(syringeProp) do
Citizen.Wait(150)
end
local playerPed = PlayerPedId()
local syringeObj = CreateObject(syringeProp, 0.0, 0.0, 0.0, true, true, false)
local syringeBoneIndex = GetPedBoneIndex(playerPed, syringeBone)
SetCurrentPedWeapon(playerPed, `weapon_unarmed`, true)
AttachEntityToEntity(syringeObj, playerPed, syringeBoneIndex, syringeOffset.x, syringeOffset.y, syringeOffset.z, syringeRot.x, syringeRot.y, syringeRot.z, false, false, false, false, 2, true)
SetModelAsNoLongerNeeded(syringeProp)
TaskPlayAnim(playerPed, syringeDict, syringeAnim, 8.0, -8.0, -1, 1, 0, 0, 0, 0)
RemoveAnimDict(syringeDict)
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if IsControlJustPressed(1, 51) then
UseSyringe()
end
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment