. . . Posted December 22, 2016 Share Posted December 22, 2016 (edited) Hello, I need help! So, if someone can help tell me is there a event that plays right when the player starts a attack? I tried "onattackother" but that plays after you landed a attack..because I wanna play a different state & I need it to happen before the attack animation starts when you're doing a attack .. If there's no event like that then does someone know how I can play a different state for a action? I tried something like this Spoiler local handle = inst.sg.sg.actionhandlers[ACTIONS.ATTACK] handle.deststate = function(inst) return "critical" end but I don't know how to undo it .. So, any help would be very great ! Edited December 24, 2016 by SuperDavid Link to comment Share on other sites More sharing options...
Neu7ral Posted December 22, 2016 Share Posted December 22, 2016 "doattack"? Link to comment Share on other sites More sharing options...
. . . Posted December 22, 2016 Author Share Posted December 22, 2016 5 hours ago, Neutral_Steve said: "doattack"? I tried "attackstart", "doattack" & "onareaattackother". None of them seemed to do anything . Link to comment Share on other sites More sharing options...
Aquaterion Posted December 22, 2016 Share Posted December 22, 2016 try, not sure when it fires but it should be before it hits: local function OnStartAttack(inst) --code end inst:ListenForEvent("startaction", function(inst, data) if data.action and data.action.action == ACTIONS.ATTACK then OnStartAttack(inst) end end) Link to comment Share on other sites More sharing options...
. . . Posted December 22, 2016 Author Share Posted December 22, 2016 (edited) "startaction" event seems to never get triggered no matter what I do, unfortunately ...but thanks for your help, Aquaterin ! I guess there's no event for something like this, that's a bummer but oh well.. Edited December 24, 2016 by SuperDavid Link to comment Share on other sites More sharing options...
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