Jump to content

When I start animation I can't move the character!![HELP]


mucuk6547

Recommended Posts

Hi, I want the character to tilt right when moving. It bends to the right, but this time it does not move, w a s d locks.

Please help me.

https://i.imgyukle.com/2023/04/20/QbJ5sf.png

local isLeaned = false
local ifp = engineLoadIFP("parkour.ifp")

function leanRight()
    if not isLeaned then
        local task = getPedTask(localPlayer, "secondary", 0)
        if task == "TASK_SIMPLE_USE_GUN" or task == "TASK_SIMPLE_IN_AIR" then
            isLeaned = true
            setPedAnimation(localPlayer, "parkour", "CartWheel", -1, false, false, false, true)
            setControlState("forwards", false)
            setControlState("backwards", false)
            setControlState("left", false)
            setControlState("right", false)
            setControlState("fire", false)
        end
    end
end
bindKey("q", "down", leanRight)

function leanLeft()
    if not isLeaned then
        local task = getPedTask(localPlayer, "secondary", 0)
        if task == "TASK_SIMPLE_USE_GUN" or task == "TASK_SIMPLE_IN_AIR" then
            isLeaned = true
            setPedAnimation(localPlayer, "parkour", "CartWheel", -1, false, false, false, true)
            setControlState("forwards", false)
            setControlState("backwards", false)
            setControlState("left", false)
            setControlState("right", false)
            setControlState("fire", false)
        end
    end
end
bindKey("e", "down", leanLeft)

function stopLean()
    if isLeaned then
        setPedAnimation(localPlayer, false)
        isLeaned = false
        setControlState("forwards", getKeyState("w"))
        setControlState("backwards", getKeyState("s"))
        setControlState("left", getKeyState("a"))
        setControlState("right", getKeyState("d"))
        setControlState("fire", getKeyState("mouse1"))
    end
end
bindKey("e", "up", stopLean)
bindKey("q", "up", stopLean)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...