Jump to content

Start and stop animation


#RooTs

Recommended Posts

I'm trying to finish my system of resistance.
but I can not make an animation stop after a while.

I've tried everything and I've been standing for some time

part of my code

server.lua

function SetAnime()
	outputChatBox("test trigger server", source, 255, 0, 0)
	setPedAnimation(source, "FAT", "IDLE_tired", 1, true, false, true)
	setTimer( setPedAnimation(source, false), 4000, 1)
end
addEvent("CancelSetAnime", true )
addEventHandler("CancelSetAnime", getRootElement(), SetAnime)

client.lua

if sprint < 0 then
        toggleControl("jump", false)
        toggleControl("sprint", false)
        sprint = 0
		triggerServerEvent("CancelSetAnime", getLocalPlayer())
end

 

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...