roddydennvor Posted February 26, 2015 Share Posted February 26, 2015 Hii there !! Can someone help me to make script when i type like : Hii < 3 character , then i will play some anim 3 second But if i type 5 character like Hello , then i will play some anim 5 second ? 1 character 1 second ... Link to comment
JR10 Posted February 26, 2015 Share Posted February 26, 2015 onPlayerChat will trigger whenever a player chats, we check for message_type to make sure that it's normal chat, not team nor /me. string.len will get the number of characters in the message. The fourth parameter in setPedAnimation is the time in milliseconds, that's why we multiplied the seconds by 1000 to get the milliseconds. You just need to replace block and anim with a string. addEventHandler("onPlayerChat", root, function(message, message_type) if (message_type) ~= 0 then return end local seconds = string.len(message) setPedAnimation(source, block, anim, seconds * 1000) --Specify the animation details end) Link to comment
roddydennvor Posted February 26, 2015 Author Share Posted February 26, 2015 can you explain me what i must to fill in block ? at anim i must to fill anim type right ? Link to comment
Max+ Posted February 26, 2015 Share Posted February 26, 2015 can you explain me what i must to fill in block ? at anim i must to fill anim type right ? Required Arguments thePed: the player or ped you want to apply an animation to. Optional Arguments NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments. block: the animation block's name. anim: the name of the animation within the block. time: how long the animation will run for in milliseconds. loop: indicates whether or not the animation will loop. updatePosition: will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations. interruptable: if set to 'false' other tasks wont be able to interupt the animation. Setting this to 'false' also gives this function more power to override other animations that are running. For example, squatting after a jump can be terminated. freezeLastFrame: ... (From 1.1 onwards). Link to comment
JR10 Posted February 26, 2015 Share Posted February 26, 2015 Check the wiki page of setPedAnimation, it has the full syntax of the function. You need two strings, one for block and one for anim. Check this list for animations: https://wiki.multitheftauto.com/wiki/Animations Link to comment
roddydennvor Posted February 26, 2015 Author Share Posted February 26, 2015 Solve : Optional Arguments NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments. block: the animation block's name. anim: the name of the animation within the block. time: how long the animation will run for in milliseconds. loop: indicates whether or not the animation will loop. updatePosition: will change the actual coordinates of the ped according to the animation. Use this for e.g. walking animations. interruptable: if set to 'false' other tasks wont be able to interupt the animation. Setting this to 'false' also gives this function more power to override other animations that are running. For example, squatting after a jump can be terminated. freezeLastFrame: ... (From 1.1 onwards). Link to comment
roddydennvor Posted February 26, 2015 Author Share Posted February 26, 2015 Thank you very much Link to comment
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