Does anyone know how I need to use the commands setPedAnimation and getPedAnimation? When I try my code (serverside) on my server, I got the error "attempt to call global 'setPedAnimation' (a nil value)".
This is the code:
function joinHandler()
local x = 1959.55
local y = -1714.46
local z = 10
spawnPlayer(source, x, y, z)
fadeCamera(source, true)
setCameraTarget(source, source)
outputChatBox("Welcome to My Server", source)
end
addEventHandler("onPlayerJoin", getRootElement(), joinHandler)
function animationTry(thePlayer, command, animation)
local a = setPedAnimation(thePlayer, "FightB_1", "FightB_1", -1, true, true, false)
end
addCommandHandler("animation", animationTry)