[STANDALONE] rCrouch

[STANDALONE] rCrouch | Rough Scripts

Looking for a crouch script? This one even includes sneaking!
I am using this resource on my RP server so I decided to share it with you.
It adds options to hold a button (for crouch) and players can change bind for prone in settings.
You can disable any option you want.

Main reason to why I decided to sell this script is because how much time I have invested into this.
It is optimized as possible and I am wanting to add more features in the next update.

Available here:
https://rough.tebex.io/package/5924145

Showcase: Untitled - Clipped with Medal.tv

Dependencies:
none

|-------------------------------------|----------------------------|
| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | 300+ |
| Requirements | none / STANDALONE |
| Support | Yes |

3 Likes

$6 for a few lines of code. Terrible.

1 Like

i dont think that the number of lines has anything to do with the quality of a resource
even having less lines of code is better for the server and its optimization

1 Like

I honestly doubt its more the 300+ lines of code… forum rules are you cant sell snippets thats are less then 200 lines of code.

Please explain yours is different , and how is that remotely “optimized” comapred to the code I just included below? (which is only 100 lines)

local stage = 0
local movingForward = false
local walkSet = "default"

local function RequestWalking(set)
    if HasAnimSetLoaded(set) then return end
    RequestAnimSet(set)
    while not HasAnimSetLoaded(set) do
        Wait(10)
    end
end

local function ResetAnimSet()
    local ped = PlayerPedId()
    if walkSet == "default" then
        ResetPedMovementClipset(ped, 0)
        ResetPedWeaponMovementClipset(ped)
        ResetPedStrafeClipset(ped)
    else
        ResetPedMovementClipset(ped, 0)
        ResetPedWeaponMovementClipset(ped)
        ResetPedStrafeClipset(ped)
        Wait(100)
        RequestWalking(walkSet)
        SetPedMovementClipset(ped, walkSet, 1)
        RemoveAnimSet(walkSet)
    end
end

RegisterNetEvent('crouchprone:client:SetWalkSet', function(clipset)
    walkSet = clipset
end)

CreateThread(function()
    local sleep
    while true do
        sleep = 1000
        local ped = PlayerPedId()
        if not IsPedSittingInAnyVehicle(ped) and not IsPedFalling(ped) and not IsPedSwimming(ped) and not IsPedSwimmingUnderWater(ped) then
            sleep = 0
            if IsControlJustReleased(2, 36) then
                stage += 1
                if stage == 2 then
                    -- Crouch stuff
                    ClearPedTasks(ped)
                    RequestWalking("move_ped_crouched")
                    SetPedMovementClipset(ped, "move_ped_crouched",1.0)
                    SetPedWeaponMovementClipset(ped, "move_ped_crouched")
                    SetPedStrafeClipset(ped, "move_ped_crouched_strafing")
                elseif stage == 3 then
                    ClearPedTasks(ped)
                    RequestWalking("move_crawl")
                elseif stage > 3 then
                    stage = 0
                    ClearPedTasksImmediately(ped)
                    ResetAnimSet()
                    SetPedStealthMovement(ped, false, "DEFAULT_ACTION")
                end
            end

            if stage == 2 then
                if GetEntitySpeed(ped) > 1.0 then
                    SetPedWeaponMovementClipset(ped, "move_ped_crouched")
                    SetPedStrafeClipset(ped, "move_ped_crouched_strafing")
                elseif GetEntitySpeed(ped) < 1.0 and (GetFollowPedCamViewMode() == 4 or GetFollowVehicleCamViewMode() == 4) then
                    ResetPedWeaponMovementClipset(ped)
                    ResetPedStrafeClipset(ped)
                end
            elseif stage == 3 then
                DisableControlAction(0, 21, true ) -- sprint
                DisableControlAction(1, 140, true)
                DisableControlAction(1, 141, true)
                DisableControlAction(1, 142, true)

                if (IsControlPressed(0, 32) and not movingForward) and Config.EnableProne then
                    movingForward = true
                    SetPedMoveAnimsBlendOut(ped)
                    local pronepos = GetEntityCoords(ped)
                    TaskPlayAnimAdvanced(ped, "move_crawl", "onfront_fwd", pronepos.x, pronepos.y, pronepos.z+0.1, 0.0, 0.0, GetEntityHeading(ped), 100.0, 0.4, 1.0, 7, 2.0, 1, 1)
                    Wait(500)
                elseif not IsControlPressed(0, 32) and movingForward then
                    local pronepos = GetEntityCoords(ped)
                    TaskPlayAnimAdvanced(ped, "move_crawl", "onfront_fwd", pronepos.x, pronepos.y, pronepos.z+0.1, 0.0, 0.0, GetEntityHeading(ped), 100.0, 0.4, 1.0, 6, 2.0, 1, 1)
                    Wait(500)
                    movingForward = false
                end

                if IsControlPressed(0, 34) then
                    SetEntityHeading(ped,GetEntityHeading(ped) + 1)
                end

                if IsControlPressed(0, 9) then
                    SetEntityHeading(ped,GetEntityHeading(ped) - 1)
                end
            end
        else
            stage = 0
        end
        Wait(sleep)
    end
end)

I think, believe and hope that he maked it with Keymapping and not in a ControlJustReleased thread like you.

i didnt make it , just a snippet from smallresources . but thats why im honestly asking whats different and make it worth paying for

as mentioned, i used keymapping instead, so players will be able to change binds to their likings

also removed bugs, since i am using this resource for almost a year on my server

and players really like the crouch option (holding a specific key for a specific time)