Hand On Radio

Hello, I noticed a lot of people have been posting a lot of the “Hand on holster” scripts, so I found the animation for the Hand on your radio! Client.lua:

RegisterNetEvent('Radio')
AddEventHandler('Radio', function()

local ped = GetPlayerPed( -1 )
    
if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then 

Citizen.CreateThread( function()
	RequestAnimDict( "random@arrests" )
	   while ( not HasAnimDictLoaded( "random@arrests" ) ) do 
                Citizen.Wait( 100 )
            end
				if IsEntityPlayingAnim(ped, "random@arrests", "generic_radio_chatter", 3) then
				ClearPedSecondaryTask(ped)
				SetCurrentPedWeapon(ped, GetHashKey("GENERIC_RADIO_CHATTER"), true)
				else
				TaskPlayAnim(ped, "random@arrests", "generic_radio_chatter", 8.0, 2.5, -1, 49, 0, 0, 0, 0 )
				SetCurrentPedWeapon(ped, GetHashKey("GENERIC_RADIO_CHATTER"), true)
            end 
        end )
    end 
end )

Server.lua:

AddEventHandler( 'chatMessage', function( source, n, msg )  

    msg = string.lower( msg )
    
    if ( msg == "/r" ) then 
    
        CancelEvent() 

        TriggerClientEvent( 'Radio', source )
    end
end )

If you need any help just ask!

Credit to @Deziel0495 for giving me the base of the code! Thanks! His post https://forum.cfx.re/t/release-gun-holster/49254

10 Likes

This is so cool thanks man

1 Like

Thanks! If you have any suggestions please let me know

1 Like

how do u install or set this up

2 Likes

You want to go to your resources folder, make a new folder called anything (make that folder in the resources) and make a lua file called “client.lua” and another one call “server.lua” copy the code from above and paste into the correct folders

1 Like

Thx buddy
this is so cool

1 Like

np! If you have any suggestions please let me know, I love doing this

1 Like

You should really give credit to @Deziel0495, but it’s up too you. Indeed you did find the animation for it but, you basiclly took all of his code and altered only the animation strings. Again you don’t have to but moral, I believe it’s the right thing to do, or at least post this in the original thread.

1 Like

OK, done! Thank you, I didnt know i needed to

1 Like

Thank you, you don’t have to but it’s a good way to show you respect and appreciate other creators/developers in the community. Thanks! :slight_smile:

1 Like

Any screenshot please ?

Where did you find a radio chatter weapon ?

1 Like

sure, its a simple thing so I only have one screenshot https://imgur.com/a/Jjdkj

1 Like

and I used trainerv model spawning>animation menu>Animations 8

1 Like

From what i can see your script gives a weapon while this should be a prop.

1 Like

? all it does is make the animation where your hand is on your radio, it shouldnt give anything

I think he means this:

SetCurrentPedWeapon(ped, GetHashKey("GENERIC_RADIO_CHATTER"), true)

You can delete this line in both places. I used this in my script to make sure the player was unarmed.

1 Like

Ohhh, ok, yeah like what Deziel said, it makes sure the ped is unarmed.

1 Like

It has to be WEAPON_UNARMED and not GENERIC_RADIO_CHATTER for that to work…

1 Like

Anyway to make this toggle when you press your mic down in game over a command?

Thanks

1 Like

thats a good idea, i would have to make the key
“N” tho.

1 Like