local Clone = nil
function main()
while not isSampAvailable() do wait(0) end
SpawnClone()
while true do
wait(0)
if doesCharExist(Clone) then
local x, y, z = getCharCoordinates(PLAYER_PED)
setCharCoordinates(Clone, x + 2, y, z - 1)
setCharHeading(Clone, getCharHeading(PLAYER_PED))
local animName, animFile = sampGetAnimationNameAndFile(sampGetPlayerAnimationId(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))))
taskPlayAnim(Clone, animFile, animName, 9, true, true, true, true, -1)
end
end
end
addEventHandler('onScriptTerminate', function(s, q)
if s == thisScript() and doesCharExist(Clone) then
deleteChar(Clone)
end
end)
function SpawnClone()
requestModel(49)
loadAllModelsNow()
Clone = createChar(4, 49, getCharCoordinates(PLAYER_PED))
markModelAsNoLongerNeeded(49)
end