Crutches is a small (218 lines of code) standalone script that allows people to use a crutch in their right arm. The crutch automatically gets hidden in vehicles and when you take out weapons. If you fall or punch someone you’ll drop your crutch, but don’t be afraid, you can always just pick it up again.
The script was just made for fun, so the code could probably have been written somewhat better, however, it is more than good enough for its purpose. The script runs at 0.0 ms when not using a crutch and anywhere from 0.0 to 0.4 ms when using it (usually 0.2 ms unless you drop the crutch).
If you find any bugs/glitches or have any suggestions feel free to post about them below.
Usage
To get out or take away your crutch you simply use the /crutch command.
Developer Info
I’m releasing the script as a standalone to allow more people to utilize it, if you wish to add the crutch as an item you’ll have to do it yourself.
You can also set the “ped movement clipset” aka. the walking style the player will revert to when no longer using the crutch, this is simply done by calling the export SetWalkStyle(walk).
Will test this at some point. Love the idea and will deffo provide decent rp for people. Github appears to be on private I assume? link doesn’t work rn
Thanks for all the kind words, sorry I didn’t respond to them, but I really do appreciate them!
I’ve heard some people have anti-cheats that delete the prop, so for anyone needing the prop name, here you go: v_med_crutch01. I hope that helps anyone who needs it.
If you wish to only use the item and not any command you’ll have to comment it out or add checks to see if you have the item in your inventory. But to keep it simple just add one of the following to a server-sided file:
QBCore.Functions.CreateUseableItem("crutch", function(source, item)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.Functions.GetItemByName(item.name) ~= nil then
TriggerClientEvent("crutches:toggleCrutch", src)
end
end)
I don’t use ESX or QBCore, so this is untested code. You’ll also have to add some database stuff for ESX at least, but you’ll have to figure that out yourself.
Hm… seems to work fine for me at least… Maybe the model isn’t loading? Try replacing -1035084591 with 3259882705, both appear to work for me, so maybe the first one is just bugged?. Alternatively, you can replace them with GetHashKey(“v_med_crutch01”).
Interestingly though, if I attempt to spawn v_med_crutch01 via vMenu’s entity spawner, it errors saying it can’t find the entity (whereas something like prop_mp_cone_01 spawns fine). I will keep digging
Hey nice script. But i have a question can you make the crutch like an item you can use ? it would be great addition to rp servers like doctors could give therm away and stuff