[RELEASE] Pepper Spray

Hello all, I am releasing this script because it was well needed for roleplay. This is a edited version of LanceGood’s Flamethrower Script. Unfortunately as of right now there is no sound for the spray and it also does not do anything to peds unlike the flamethrower. It is just a Pepper Spray can with the effects. So when you Spray somebody they need to manually rp it out. Feel free to edit this and make it better! :smiley:

Update: @xander1998 added some stuff, we should now have effects and what not! :grinning:

How To Use
/pepperspray

Preview

Download

Credits
Saw Script: @xander1998
Everything else: @LGDevelopment
Pepper Spray Script Modifications: @Milly
Pepper Spray Model: @JoeIsBad
https://www.lcpdfr.com/files/file/21404-wip-unfinished-pepper-spray-can-10/

17 Likes

Neat /////

1 Like

is there a way to trigger this via a button on the keyboard, ?

1 Like

yes there is

1 Like

how would i go around of adding that please,
if someone is running at me, i dout i have time to type /pepperspray

but it is extremely good, but just asking how to use it quicker

2 Likes

Does the player on the other end of the spray have any effect to this or do they just RP that they got sprayed?

2 Likes

It needs to be RPed out

1 Like

Ah. Would be nice to actually add an effect to this that way you can get around players not RPing it out.

  1. When you press the fire button you draw a raycast from the model to a position in front of the player.
  2. If it hits a ped check if it is a player. If it is a player grab their server ID.
  3. Trigger a server event that triggers a client event on that stored player ID.
  4. Add the visual effects / effects in general to that client you sprayed.
4 Likes

im a good guys.
if no one answer you i will but not right now…
im a little busy.

1 Like

Need Breathing Animation…
Like This.

1 Like

OOOO Very neat!

2 Likes

You’re famous

2 Likes

Xander does have some great ideas to enhance the script

1 Like

You can edit the / command in the server.lua line 1.

:joy: I know very little about scripting actually which is why it is edited from another script. Somebody else would need to set up the code and what not and send it to me. Which is why I said in the post “Feel free to edit this and make it better!”

Im more of a texture maker kind of guy.

:smile: Give me a day or so and I will see about adding that in for you and pushing the code to your github repo.

2 Likes

Ok Thanks

Okay thank jesus for you my man, This is now…

Certified as Epic :tm:

Nice work! If you want I have a solution for making the pepperspray incapacitate players.

You should use a ragdoll method that is performed on the person that is within the range of the spray (maybe a yard?) and make it run for three or so seconds.

It would most likely need to be executed on the person from the server.

I might do it myself if thats okay, but right now I need to restudy FiveM Lua Coding since there have been many changes that have even broke my old scripts from March 2018 (which is alright).

Again, nice work, and keep it up!

EDIT: +1 On what @xander1998 said:

 Ah. Would be nice to actually add an effect to this that way you can get around players not RPing it out. 
1. When you press the fire button you draw a raycast from the model to a position in front of the player.
2. If it hits a ped check if it is a player. If it is a player grab their server ID.
3. Trigger a server event that triggers a client event on that stored player ID.
4. Add the visual effects / effects in general to that client you sprayed.
1 Like

If you want to edit it yourself go for it. Its open.

I have added the things I told you I would add. It has been tested and it is waiting on your repo’s pull request.

1 Like