آخر مرة جاهز
--
جرب,
local ped = createPed ( ID, x, y, z, rot )
setElementFrozen ( ped, true )
local marker = createMarker ( x, y, z, "cylinder", 2, 255, 0, 0 )
addEventHandler ( "onMarkerHit", marker, function ( player )
if getElementType ( player ) == "player" then
outputChatBox ( "Press Enter ", player, 255, 255, 0 )
end
end
)
function anim ( player )
if isElementWithinMarker ( player, marker ) then
local ob = createObject ( 1950, 0, 0, 0, 0, 0, 0 )
setPedAnimation ( player, "BAR", "dnk_stndM_loop" )
exports [ "bone_attach" ]:attachElementToBone ( ob, player, 12, 0.015, 0.03, 0, 180, 0, 0 )
setTimer ( function ( ) destroyElement ( ob ) end, 3000, 1 )
setTimer ( setPedAnimation, 3000, 1, player, false )
setTimer ( setPedAnimation, 5000, 1, player, "RYDER", "RYD_Die_PT1" )
setTimer ( setPedAnimation, 10000, 1, player, false )
end
end
addEventHandler ( "onResourceStart", resourceRoot, function ( )
for _, v in ipairs ( getElementsByType ( "player" ) ) do
bindKey ( v, "enter", "down", anim )
end
end
)
addEventHandler ( "onPlayerJoin", root,
function ( )
bindKey ( source, "enter", "down", anim )
end
)