Here is what I have done so far. All i need is an anim that is holding his LEFT arm up. So when you just are holding the bong, you’re holding it upright. All the of the “drink” anims, like beer, coffee, etc. are all RIGHT arm. So He still just holding it sideways 0.o
RegisterCommand("bong",function(source, args)
local ad1 = "anim@safehouse@bong"
local ad1a = "bong_stage1"
local player = GetPlayerPed(-1)
local plyCoords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(PlayerId()), 0.0, 0.0, -5.0)
local bongspawned = CreateObject(GetHashKey(bongmodel), plyCoords.x, plyCoords.y, plyCoords.z, 1, 1, 1)
local netid = ObjToNet(bongspawned)
if (DoesEntityExist(player) and not IsEntityDead(player)) then
loadAnimDict(ad1)
RequestModel(GetHashKey(bongmodel))
if holdingbong then
Wait(100)
ClearPedSecondaryTask(GetPlayerPed(-1))
DetachEntity(NetToObj(bong_net), 1, 1)
DeleteEntity(NetToObj(bong_net))
bong_net = nil
holdingbong = false
else
Wait(500)
SetNetworkIdExistsOnAllMachines(netid, true)
NetworkSetNetworkIdDynamic(netid, true)
SetNetworkIdCanMigrate(netid, false)
AttachEntityToEntity(bongspawned,GetPlayerPed(PlayerId()),GetPedBoneIndex(GetPlayerPed(PlayerId()), 18905),0.10,-0.25,0.0,95.0,190.0,180.0,1,1,0,1,0,1)
Wait(120)
Notification("Press ~r~[E]~w~ to take a toke!")
bong_net = netid
holdingbong = true
end
end
while holdingbong do
Wait(0)
local plyCoords2 = GetEntityCoords(player, true)
local head = GetEntityHeading(player)
if IsControlJustPressed(0, 38) then
TaskPlayAnimAdvanced(player, ad1, ad1a, plyCoords2.x, plyCoords2.y, plyCoords2.z, 0.0, 0.0, head, 8.0, 1.0, 4000, 49, 0.25, 0, 0)
Wait(100)
Notification("You take a huge rip!")
Wait(7250)
TaskPlayAnim(player, ad2, ad2a, 8.0, 1.0, -1, 49, 0, 0, 0, 0)
end
end
end, false)
I also cant figure out a smoke particle effect. I am trying to attach it to the player, but to no avail.(not in this code)