BigYoda
September 14, 2018, 9:47am
1
Hi, Im working on an action menu atm but, I’m having some problem with
AttachEntityToEntity("prop_riot_shield", GetPlayerPed(PlayerId()), GetPedBoneIndex(GetPlayerPed(PlayerId()), 61163), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 1, 0, 1, 0, 1)
It doesnt seem to do anything. I tried to debug it with print('Works?')
Nothing prints.
I trigger it through this but I dont think it works.
elseif WarMenu.Button('Shield') then TriggerEvent("shield")
Any help is appreciated. Thanks!
oMarkez
September 14, 2018, 10:11am
2
I use this:
local shield = CreateObject(GetHashKey(prop), pedPos.x, pedPos.y, pedPos.z, 1, 1, 1)
shieldEntity = shield
AttachEntityToEntity(shieldEntity, ped, GetEntityBoneIndexByName(ped, "IK_L_Hand"), 0.0, -0.05, -0.10, -30.0, 180.0, 40.0, 0, 0, 1, 0, 0, 1)
And of course define pedPos
BigYoda
September 14, 2018, 10:38am
4
Wait, It spawns the shield like 20 ft infront of you and Is not attached?
oMarkez
September 14, 2018, 11:04am
5
Hmm, you sure you defined pedPos properly? I mean… it works for me xD
1 Like
oMarkez
September 14, 2018, 11:04am
6
I do however, use it with an anim, that might be the trick.
BigYoda
September 14, 2018, 11:20am
7
Can I see your whole code with the Attached Prop?
oMarkez
September 14, 2018, 11:35am
8
Try look at this, I use some snippets from Xander’s code here:
local shieldActive = false
local shieldEntity = nil
local hadPistol = false
-- ANIM
local animDict = "combat@gestures@gang@pistol_1h@beckon"
local animName = "0"
local prop = "prop_ballistic_shield"
local pistol = GetHashKey("WEAPON_PISTOL")
RegisterCommand("shield", function()
if shieldActive then
DisableShield()
else
EnableShield()
end
end, false)
function EnableShield()
This file has been truncated. show original