irswat Posted January 9, 2017 Share Posted January 9, 2017 I think you need to attach that script to the object you are activating, and then fill in the properties in CK. Link to comment Share on other sites More sharing options...
FrankFamily Posted January 9, 2017 Share Posted January 9, 2017 Yeah, i'd bet you haven't filled Gold001 property in the ck. This tutorial covers it:http://www.creationkit.com/index.php?title=Bethesda_Tutorial_Papyrus_Introduction_to_Properties_and_Functions Link to comment Share on other sites More sharing options...
NexusComa Posted January 9, 2017 Share Posted January 9, 2017 Scriptname _aaa_FiftyFifty Extends ObjectReference ;* Fifty gold, fifty percent of the timeMiscObject Property Gold001 AutoActor Property PlayerRef AutoInt Property Gold Auto;Event OnInit() GoToState("Done")EndEvent;Event OnActivate(ObjectReference akActionRef) If(akActionRef==(PlayerRef)) If(PlayerRef.GetItemCount(Gold001)>=(Gold)) If(Utility.RandomInt(0,1)==(0)) PlayerRef.AddItem(Gold001, Gold) Else PlayerRef.RemoveItem(Gold001, Gold) EndIf Else ; Debug.Notification("Not enough gold") Endif Endif GoToState("Done")EndEvent;State Done ;do nothingEndState; This code is perfect as stands ... From the Creation Kit add 50 to the Gold Property. (or whatever amount you want) Link to comment Share on other sites More sharing options...
FrankFamily Posted January 9, 2017 Share Posted January 9, 2017 May i ask why do you go to a state both on init and after each time it runs, to never come back and then not add a single function to this "done" state? As far as i know and understand it is essentially picking the function from the empty state every time so the done state remains, to the best of my knowledge, useless. Link to comment Share on other sites More sharing options...
NexusComa Posted January 9, 2017 Share Posted January 9, 2017 (edited) May i ask why do you go to a state both on init and after each time it runs, to never come back and then not add a single function to this "done" state? As far as i know and understand it is essentially picking the function from the empty state every time so the done state remains, to the best of my knowledge, useless.You are correct ... Take that line out. That was for a different script that only ran once.My bad, good eye. You can auto fill Gold001 and PlayerRef, then make Gold 50 and it works fine. Edited January 9, 2017 by NexusComa Link to comment Share on other sites More sharing options...
xcafe Posted January 9, 2017 Share Posted January 9, 2017 (edited) @gunabuse, did you get this working? Edited January 9, 2017 by xcafe Link to comment Share on other sites More sharing options...
Recommended Posts