Hand On Radio

dmed you the m menu discord

1 Like

Was trying to make the on key press version for everyone, not sure what I did wrong, but its not working for LEFT ALT - 19

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		if(IsControlJustPressed(1, 19)) then
			local ped = GetPlayerPed( -1 )
			
			if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then 
				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 
		
		if(IsControlJustReleased(1, 19)) then
			-- do nothing
		end
	end
end)

if someone else wants to pick up where i stopped feel free.

1 Like

try adding a extra end at the bottom just after do nothing control

1 Like

if thats all it is ill be so mad lol

1 Like

np did you get it too work then lol

1 Like

that was all it was, but it was toggle not press release so i had to do some more work, but you helped alot thanks!

1 Like

How can i get the hand on the radio on my RP

Handonradio.rar (869 Bytes) for people that dont no how to do it

1 Like

Great job!
(20 chars)

1 Like

Original_Gamers i wanna make it if i press left alt its makes the command can you give me the server.lua ?

1 Like

I don’t think you understand pressing a key is pointless executing a command, you can assign it so if you press left alt it will perform the hand on radio animation or function.

https://wiki.fivem.net/wiki/Controls

i understand that but i don’t have the developed file for the button this server.lua it’s working for a msg

1 Like

wich is the right one

Can you please post the code for release?

where do i put this for it to work

can someone help me by making it the alt key instead of having to type in/r in chat

Is this server side only, or also client side

How can i make it that only cops allowed to do it?. And when i press CAPS LOOK it do the hand on radio cuze i have a script for realistic radio sound.

Can someone show me a screenshot?

cOOl.