Trundles Roleplay Animations [Updated 7-11-19]

@TrundleTheGreat I suggest adding this to one of the functions so that players can simply hit X to cancel any animation thats going instead of having to type out /e <animation> again.

local cancelAnimation 			= 73 -- X by default
-- cancel animations 
if (IsControlJustPressed(0,cancelAnimation))  then
	local ped = PlayerPedId()
	if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
		radioActive = false 
		ClearPedSecondaryTask(ped)
		
		DetachEntity(prop, 1, 1)
		DeleteObject(prop)
		DetachEntity(secondaryprop, 1, 1)
		DeleteObject(secondaryprop)
	end

end
1 Like

Thanks @lowheartrate that works great :slight_smile:
But when I use /e umbrella and then stop the animation with X or the same command the umbrella is still in my hands when the animation stops?

hmm I would restart the server after making the changes to the code and try that. If that continues to not work then make sure that you are using

DetachEntity(prop, 1, 1)
DeleteObject(prop)
ClearPedSecondaryTask(PlayerPedId())

@lowheartrate Tried everything and nothing is working.
Thought your code was working but it is not.
Guess I will wait for an official fix.

1 Like

Where should i add it in client lua? in some random function?

1 Like

I tested /e umbrella and hit X and it worked fine for me :man_shrugging:
https://i.imgur.com/cwQVg9A.gif

I threw it in the client.lua right under the hands up (H) animation like this - cancel animation - Pastebin.com

I do not get what is happening?
All of a sudden the emotes are not working anymore?
I even did a fresh install of the script and when I do any /e commands my char does nothing and the /e command just shows up in chat?

@lowheartrate
EDIT I figured out what the issue is with emotes not working all of a sudden.
How can i get Roleplay Animations to work with this:

With normal chat enabled the /e commands work.
With customchat system enabled the /e commands do nothing.

1 Like

If you can find the file you can add it yourself :slight_smile:

1 Like

I have the same problem, I use customchat and the commands do not work for me … Would it work?

I never figured it out :frowning:

How can i make the radio hold to talk, what i mean is i need to push ā€œUā€ twice, one to talk and one to stop the animation, how can i just make that animation hold to talk, so i have to hold it talk on radio then leave the bottom.

I tried changing the keybind to another one, literally just exchanged the X key id for the Z key id and it won’t work, any idea why?

Couldn’t imagine why it would be doing that changing the key control. Make sure you have the proper control number?

Yeah I have no idea either, this is what I was basing all my controls off of

Can shoot while having hands up. Any idea how to fix that?

For some reason the note pad and pencil don’t detach, anyone know how to fix this?

I learn to use animation with your code… thank you very much for your work.
I have spawn a prop for my anim, found the bodypart to glue it to… rotate it to fit the situation
I made my perfect anim thanks to you! And learned the importance of deleting props.

2 Likes

Here is a much needed update to something I didn’t think would be this popular.
Some notable new features:

  • Added /e stuckprop - delete props glued to your hand
  • Added /e stop - cancel current animation
  • Added /e help - list of current animations in chat
  • Added hover over holster if you press K
  • Restarting the script live will also clear props for all clients
  • Setup the animations and props in a Config, should be a little easier to add these to a menu
  • Some basic nightclub animations and dances, you can add the rest yourself
  • Should now unload animdic/propmodels

Thank you for 30k views and 3k+ downloads, that is pretty awesome to see.

4 Likes

I’m looking through the script (which is amazing, by the way), and it doesn’t look like I can easily add the ā€œscenarioā€ style animations. I was thinking I could get rid of another resource for those if I could combine them into this one. But this section looks like it’s only going to play that one hard coded scenario:

elseif Config.Anims[i].data.type == 'scenario' then
						if vehiclecheck() then
							if IsPedActiveInScenario(player) then
								ClearPedTasks(player)
							else
								TaskStartScenarioInPlace(player, 'WORLD_HUMAN_COP_IDLES', 0, 1)   
							end 
						end
					else

Am I understanding that correctly? And how would I add multiple scenario choices?

Correct it is only going to play that 1 scenario. If you want it to play any scenario then add this @OnyxEye

RegisterNetEvent('Radiant_Animations:Scenario')
AddEventHandler('Radiant_Animations:Scenario', function(ad)
	local player = PlayerPedId()
	TaskStartScenarioInPlace(player, ad, 0, 1)   
end)

Line 221, where we played the original scenario, we replace with the following

						local ad = Config.Anims[i].data.ad

						if vehiclecheck() then
							if IsPedActiveInScenario(player) then
								ClearPedTasks(player)
							else
								TriggerEvent('Radiant_Animations:Scenario', ad)
							end 
						end

If you want to add more go to the config.lua and look for ā€˜copidle’ on line 44
Where it says ā€˜ad =’ put your desired scenario there like this

 {name = 'copidle', data = {type = 'scenario', ad = "WORLD_HUMAN_COP_IDLES", anim = "", prop = 0, proptwo = 0, boneone = nil, bonetwo = nil, body = 33, x = 0.0, y = 0.0, z = 0.0, xa = 0.0, yb = 0.0, zc = 0.0}},
 {name = 'smoking', data = {type = 'scenario', ad = "WORLD_HUMAN_AA_SMOKE", anim = "", prop = 0, proptwo = 0, boneone = nil, bonetwo = nil, body = 33, x = 0.0, y = 0.0, z = 0.0, xa = 0.0, yb = 0.0, zc = 0.0}},
1 Like