Jump to content

[Function] Idle anims


Kazafka

Recommended Posts

This function is for creating idle animations, on player's afk/idle. Aaand, u need to probably put this one in "onResourceStart" event, remember, to make it work. Here it comes:

setTimer(
	function()
		for _, player in ipairs(getElementsByType("player")) do
			if(getPlayerIdleTime(player) > 10000) then
				local veh = getPedOccupiedVehicle(player)
				if veh then
					setPedAnimation(player, "car", "Sit_relaxed", -1, false, false, true, true, 250, false)
				else
					local anim = math.random(1, 5)
					if(anim == 1) then
						setPedAnimation(player, "playidles", "stretch", -1, false, false, false, false)
					elseif(anim == 2) then
						setPedAnimation(player, "playidles", "strleg", -1, false, false, false, false)
					elseif(anim == 2) then
						setPedAnimation(player, "playidles", "time", -1, false, false, false, false)
					elseif(anim == 2) then
						setPedAnimation(player, "playidles", "shldr", -1, false, false, false, false)
					elseif(anim == 2) then
						setPedAnimation(player, "playidles", "shift", -1, false, false, false, false)
					end
				end
			end
		end
	end
5000, 0)

 

That's what I wanted to create, mentioning my latest post :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...