shavkacagarikia Posted October 21, 2016 Share Posted October 21, 2016 Hello, any ideas how can I get the last dismissed companion in script and then do stuff on that actor? Link to comment Share on other sites More sharing options...
EveningTide Posted October 21, 2016 Share Posted October 21, 2016 (edited) The actor needs to be stored to a variable just before the function to dismiss it is called. And by actor, I mean their actorbase, since these are going to be unique actors and no worry of taking leveled actors into account. Edited October 21, 2016 by EveningTide Link to comment Share on other sites More sharing options...
shavkacagarikia Posted October 21, 2016 Author Share Posted October 21, 2016 And how can I store it in variable if it could be any of companions and it isn't known which one? Link to comment Share on other sites More sharing options...
shavkacagarikia Posted October 23, 2016 Author Share Posted October 23, 2016 bump Link to comment Share on other sites More sharing options...
registrator2000 Posted October 24, 2016 Share Posted October 24, 2016 Register for the CompanionChange event on FollowersScript - the first argument (Actor ActorThatChanged) contains a reference to the actor that was dismissed when the second argument (bool IsNowCompanion) is false. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted October 24, 2016 Author Share Posted October 24, 2016 Register for the CompanionChange event on FollowersScript - the first argument (Actor ActorThatChanged) contains a reference to the actor that was dismissed when the second argument (bool IsNowCompanion) is false.I have never used custom events and I'm probably doing something wrong: RegisterForCustomEvent(FollowersScript,"CompanionChange") gives error.Can you explain in more detail? Link to comment Share on other sites More sharing options...
ablindm4n Posted October 24, 2016 Share Posted October 24, 2016 Are you registering from outside of the FollowersScript? You will want to use RegisterForRemoteEvent for that if so. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted October 25, 2016 Author Share Posted October 25, 2016 My bad... Will try that. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted October 25, 2016 Author Share Posted October 25, 2016 It seems I misunderstood something. RegisterForRemoteEvent(FollowersScript, "CompanionChange"), Gives error "CompanionChange is not an event on followersscript or one if its parents" Link to comment Share on other sites More sharing options...
ablindm4n Posted October 26, 2016 Share Posted October 26, 2016 My bad, you can't seem to use RegisterForRemoteEvent for custom events. You should pass FollowersScript.GetScript() instead though: RegisterForCustomEvent(FollowersScript.GetScript(), "CompanionChange") Link to comment Share on other sites More sharing options...
Recommended Posts