MaurO^ Posted September 9, 2018 Posted September 9, 2018 I have a problem loading the custom animation, when I write / anim dance1 the animation does not start, if I do it only from the client side it works. Is it possible to do this with triggers? Cliente.lua: local name = "bailes_fornite" local IFP = engineLoadIFP( "bailes.ifp", name) if not IFP then outputChatBox( "Fallo al cargar el archivo 'bailes.ifp'" ) end function setAnimation(_, animationName) if IFP then --setPedAnimation(localPlayer, name, anim ) triggerServerEvent("onAnim", localPlayer, name, animationName) end end addCommandHandler("anim", setAnimation) Server.lua: function animar(name, animationName) setPedAnimation(source, name, animationName) end addEvent("onAnim", true) addEventHandler("onAnim", root, animar)
Mr.Loki Posted September 9, 2018 Posted September 9, 2018 You need to trigger from the server to the client not the other way around. local name = "bailes_fornite" local IFP = engineLoadIFP( "bailes.ifp", name) if not IFP then outputChatBox( "Fallo al cargar el archivo 'bailes.ifp'" ) end function setAnimation(animationName) setPedAnimation(source, name, animationName) end addEvent("onAnim", true) addEventHandler("onAnim", root, setAnimation) function animar(plr, _, animationName) triggerClientEvent("onAnim", plr, animationName) end addCommandHandler("anim", animar) 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now