Simple /onduty & /co (community officer) script

I decided to start learning lua, make scripts for fivem and here’s my first script:

Simple script with 3 commands, /onduty which gives weapons :gun: and armour :shield: (by default 100% armour and a nightstick, flashlight, combat pistol with flashlight, pump shotgun with flashlight, stungun and carbine rifle with grip, flashlight and scope) to the ped.

/co (stands for :police_car: community officer :policeman:) which changes the player’s ped (by default “s_m_y_sheriff_01”) and spawns a vehicle :oncoming_automobile: (by default “sheriff”) and teleports the player into the vehicle. :red_car:

There’s also a misc command (/clearw) that clears all of the player’s weapons :no_entry_sign: (typically to be used when you’re coming off-duty and want to quickly get rid of police weapons)

Download
OnDutyCommand.rar (1.6 KB)

9 Likes

Great script! :grinning::grinning::grinning::grinning:

6 Likes

you guys are chads :heart:

4 Likes

Do you have any screenshots?

1 Like

ive tried using custom peds but dont work is this only set up for replaced vehicles and peds?

1 Like

when i do /onduty, it ways incorrect password

1 Like

You’ve probably got another script interfering with that… If you look at the code for mine there’s no password function or anything along those lines… maybe change the command in mine to a different command that isn’t being used in your server?

1 Like

Can you put it so where the carbine rifle does not include the scope and grip?

1 Like

Yea that’s hella easy to do… just give them weapon_XXXX and don’t put anything in brackets after it then it’ll give it no attachments (Client script)

1 Like

Can you make a script which requires password to become Cop please !!!

1 Like

you can setup permissions for scripts using [DiscordAcePerms] (DiscordAcePerms [Release])

3 Likes

It would be awesome if you could make it so when you do the /co script you get access to badgers 911 script and also can drag people, cuff people, and put people in your car. Great script though!

Awesome Script thank you!

How can you setup permissions with that?

what would be the ace permissions for this

https://docs.fivem.net/docs/game-references/ped-models/

@WadL There’s a problem with your script, if you die and type /co you get revived and placed in a car! You can also get out of the car, get back in the car and drive away.

did you ever do it

How so

Is there a way to make the ped spawn a certain version? (Like the sheriff ped with a vest.)