[Standalone] Crutches

Crutches

Showcase

Preview video (YouTube)
A really small preview of the script.

About

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).

Example:

exports.crutches:SetWalkStyle("move_m@gangster@var_e")

Download

Github:

Direct download: crutches_1.1.5.zip (82.3 KB)

Some of my other scripts
[Standalone] [Paid] Sit Anywhere
[Standalone] [PAID] Slash Tires
[Release] Telescopes

27 Likes

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 :smile:

Oops! Thanks for telling me, I forgot to make it public :sweat_smile:

3 Likes

Good Job! :slight_smile:

I saw someone selling essentially the same thing for like 20$ :rofl:

1 Like

Great idea, Nice job!

1 Like

Nice job, i loved

1 Like

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.

The irony in a “Standalone” script for Crutches made me giggle - work looks awesome :slight_smile:

Great script!! Can’t wait to try it hehe… yeah I agree with @ThatStrykerGuy :rofl: :rofl: that irony though

1 Like

Hello do you know how I can put it in article? instead of a command

What do you exactly mean by article? Do you mean an item/object?

Yes, item sorry

No, all fine, don’t apologize!

I’m unsure of what framework you use, but I’ll give you two examples, one for ESX and one for QBCore.

Since there is not an event to trigger by default you’ll have to add this in client.lua at the bottom of the crutches script:

RegisterNetEvent('crutches:toggleCrutch')
AddEventHandler('crutches:toggleCrutch', function()
    ToggleCrutch()
end)

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:

ESX:

ESX.RegisterUsableItem('crutch', function(source)
    TriggerClientEvent("crutches:toggleCrutch", source)
end)

QBCore:

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.

I hope this helps.

Thank you
but ^^ there are no crutches

Are there any errors? (either server-side or client?)
If you have an anti-cheat it may remove the prop.

I am also having the same problem - the crutch doesn’t appear. Running on a fresh server install on build 2545

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”).

Strange, neither of those work.

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

Hey! Someone asked for that further up in the post, here is the answer I gave them: