Crouch & Crawl is a standalone resource that allows you to crouch and crawl (duh!). It differs from other similar scripts by having better/more animations, no standing up while crouching, keeping your walkstyle, as well as many small bug fixes.
Features
Crouching
Keeps walkstyle
No random standing up while crouched (no ambient anims)
Allows for stealth mode (configurable)
No speed bug etc.
Shooting while crouched
Keymapping
Crawling
Diving animation
Integrated with crouching
Moving forward/backwards anims
Getting up/down animations
Flipping from/to back
Keymapping
Note:
There is not shooting while crawling/prone as it would either look super weird (not aiming where you are shooting at) or it not be synced with other players at all.
Keybinds
The script uses keymapping for its keybinds, the default keybinds are as follows:
Left Control Crouch Right Control Crawl Space Flip (while crawling) (not keymapped)
Users can change these in the pause menu under Settings>Key Bindings>Fivem. Server owners can change the default ones in the config file.
Resmon
Idle: 0.0 ms
Crouching: 0.07 ms
Crawling: 0.06 ms
Exports
There are 4 exports included with the script (all are client).
Export
Description
Parameter(s)
Return type
IsPlayerCrouched
Returns if the player is crouched
None
Boolean
IsPlayerProne
Returns if the player is prone (both when laying still and when moving)
None
Boolean
IsPlayerCrawling
Returns if the player is crawling (only when moving forward/backward)
None
Boolean
GetPlayerProneType
Returns if the player is on his back or front
None
String
Contributers
These are people who helped out developing the resource, a big thanks go to them!
@iSentrie for adding improvements, testing and suggestions. @anon70864786 for testing and suggestions.
And thanks to NotDoctorMike on Twitter for the crawl dive animation suggestion.
I really like it too.
I replaced the old crouch with this one in the server.
But got one question. Would it be possible to make it so people can crawl under the trucks?
Tried it and didn’t seem to be possible to crawl under something where it would have been possible to fit.
I’ve so far been unable to figure out a way to allow people to crawl under things. The problem seems to be that the collision with the environment doesn’t change even if the ped is crawling. So the game seems to act as if the ped was standing up.
The script works perfectly fine when it comes to the shooting hitbox tho, so I’m a little unsure of why this is, maybe they use simplified boxes for collisions with the environment?
As of now, no. The issue with that is that it either is not synced with others (you become invincible and stand up) or you don’t shoot where you aim.
I have been experimenting on ways to allow it, but so far the results have been mediocre.
Alright, well I am looking for a script that has that for my server so whenever you figure out a way to get it to work lmk and I def will be switching to your script.
There’s a lot of crouching and crawling scripts, but it effects your walkstyle and misleads the audience into thinking you can shoot while crawling etc. Mads has been a phenomenal help with the menu and with everyone releasing some copy paste crouching or crawling script and not understanding proper natives etc, it only made sense for Mads to release this as it’s own script for those who don’t use RPEmotes etc
Added GetPlayerProneType as an export. This can be used to get if the player is on his back or on his stomach.
And as a note:
I’m currently working on a way to allow players to crouch/crawl under objects etc., so far it’s been working relatively well, but it’s still somewhat clunky. Here is a small teaser: FiveM - Crawling under things? - YouTube, more info on this later.
I’ve been tweaking the values for a native a little back and forth the last couple of days, but I haven’t found any that work how I want them to. But I’ll probably release it before the week is over.
Is it possible if you’d implement that you can shoot while prone. I mean if it’s not synched can’t you try to sync it? I think many people would love to have that.
It would probably look weird and break your spine etc. We did try with RPEmotes which this is implemented into, however found it was easier to just not try and fight the headaches lol
So at the moment while “ducking” you can shoot in third person, however if you have a resource that forces first person it throws you into third person shooting or makes you body look all weird.
Would you be able to implement something to disable shooting in ducking entirely? Trying to find where it was disabled for crawling/prone but a bit lost.
---Starts the crouch loop
local function CrouchThread()
CreateThread(function()
local playerId = PlayerId()
while isCrouched do
local playerPed = PlayerPedId()
-- Checks if the player is falling, in vehicle, dead etc.
if not CanPlayerCrouchCrawl(playerPed) then
isCrouched = false
break
end
-- Limit the speed that the player can walk when aiming
if IsPedAiming(playerPed) then
SetPedMaxMoveBlendRatio(playerPed, 0.15)
end
-- This blocks the ped from standing up and playing idle anims (this needs to be looped)
SetPedCanPlayAmbientAnims(playerPed, false)
-- Disables "INPUT_DUCK" and blocks action mode
DisableControlAction(0, 36, true)
if IsPedUsingActionMode(playerPed) == 1 then
SetPedUsingActionMode(playerPed, false, -1, "DEFAULT_ACTION")
end
-- Disable first person
DisableFirstPersonCamThisFrame()
DisablePlayerFiring(playerId, true) -- Disable player shooting
Wait(0)
end
-- Reset walk style and ped variables
ResetCrouch()
end)
end
It doesn’t stop the player from taking out a gun and aiming it etc. but you can’t shoot at least.
Do you think it would be possible to implement this feature in the future? Because as of right now it seems like a fun gimmick, but not very useful tbh.