sh0ker Posted May 17, 2016 Share Posted May 17, 2016 Hey,I have added a new armor into the game now just for testing I want to display a message when someone equip it, I made this script: ScriptName EquipRobesScriptTest extends ObjectReference Event OnEquipped(Actor akActor) Debug.MessageBox("Hey") endEvent But for some reason It doesn't work.Yes I've attached the script to the item Link to comment Share on other sites More sharing options...
FrankFamily Posted May 17, 2016 Share Posted May 17, 2016 (edited) Are you equipping it by any means other than normally from the inventory?From my experience OnEquipped/OnUnequipped are not reliable events and will not fire at times but this is noticiable when doing something that requires specific order of equipped and unequipped in order to not mess stuff up. In such a simple script it should fire fine at least once if you equip it a few times and as said before try from inventory if you are not, no hotkeys or anything. Edited May 17, 2016 by FrankFamily Link to comment Share on other sites More sharing options...
sh0ker Posted May 17, 2016 Author Share Posted May 17, 2016 Are you equipping it by any means other than normally from the inventory?From my experience OnEquipped/OnUnequipped are not reliable events and will not fire at times but this is noticiable when doing something that requires specific order of equipped and unequipped in order to not mess stuff up. In such a simple script it should fire fine at least once if you equip it a few times and as said before try from inventory if you are not, no hotkeys or anything. I am equipping it from the inventory but nothing happens :S Link to comment Share on other sites More sharing options...
Elias555 Posted May 18, 2016 Share Posted May 18, 2016 Weird. Are you using a coc character that is seeing the item for the first time? What happens when you use OnObjectEquipped? Link to comment Share on other sites More sharing options...
Sjogga Posted May 18, 2016 Share Posted May 18, 2016 I believe that unless the item is a persistant reference, it will not register events as an objectreference. Link to comment Share on other sites More sharing options...
sh0ker Posted May 18, 2016 Author Share Posted May 18, 2016 I believe that unless the item is a persistant reference, it will not register events as an objectreference. How do I know if the item is persistent or not? I simply made a copy of a similar item and changed the name and stats.Then I added it to my inventory using player.additem Weird. Are you using a coc character that is seeing the item for the first time? What happens when you use OnObjectEquipped? I basically equip it on myself and it doesn't work, I will try OnObjectEquipped thanks Link to comment Share on other sites More sharing options...
FrankFamily Posted May 18, 2016 Share Posted May 18, 2016 OnObjectEquipped runs on actor and triggers for each object equipped by it, OnEquipped runs of the object and triggers when it's equipped, different things. Link to comment Share on other sites More sharing options...
NexusComa Posted May 18, 2016 Share Posted May 18, 2016 (edited) Try this: ScriptName RobeScript Extends ObjectReferenceActor Property PlayerRef Auto HiddenEvent OnInit() GoToState("Park")EndEvent;---------------------------------Event OnEquipped(Actor akActor) Debug.MessageBox("Hey ...") GoToState("Park")EndEvent;---------------------------------State Park ;parkingEndState; Edited May 18, 2016 by NexusComa Link to comment Share on other sites More sharing options...
sh0ker Posted May 18, 2016 Author Share Posted May 18, 2016 Okay, i managed to make it work, it's kinda funny but the way it worked is that I dropped the item on the floor then picked it up.My guess is that because I used player.additem and the item wasn't loaded or something it was only an inventory reference (this is my guess) Link to comment Share on other sites More sharing options...
NexusComa Posted May 19, 2016 Share Posted May 19, 2016 (edited) Hmm, well the script I posted for you works perfectly and is also put together correctly. Edited May 19, 2016 by NexusComa Link to comment Share on other sites More sharing options...
Recommended Posts