Predence00 Posted October 20, 2016 Share Posted October 20, 2016 In a house mod I made, I have a script attached to a sign that when you choose to pay 5000 gold you get the deed and it should enable the various workbenches used to build the house.But for some people they are stating that this sign will take the 5000 gold and give the deed but will not enable the workbench or it will not do anything but take 5000 gold. Any reason for this? Script:ObjectReference Property ObjectEnabled autoMessage Property SteadingMenuMessage autoLeveledItem Property DeedGuideLeveledList autoMiscObject Property Gold autoEvent OnActivate(ObjectReference akActionRef) SteadingBuyMenu()EndEventFunction SteadingBuyMenu(int MsgButton = 0) MsgButton = SteadingMenuMessage.Show() If MsgButton == 0 Game.FadeOutGame(false, true, 2.0, 2.0) ObjectEnabled.enable() Game.GetPlayer().AddItem(DeedGuideLeveledList, 1, false) Game.GetPlayer().RemoveItem(Gold, 5000,false) ElseIf MsgButton == 1 EndIfEndFunction I have tested this multiple times with multiple different mods but can't recreate the issue. Link to comment Share on other sites More sharing options...
FrankFamily Posted October 20, 2016 Share Posted October 20, 2016 Nothing seems wrong to me, you may want to check that activator is the player and check if its enabled before removing the gold in the case enable fails for whatever reason. I'd write it like this: Scriptname lalal Extends ObjectReference ObjectReference Property ObjectEnabled auto Message Property SteadingMenuMessage auto LeveledItem Property DeedGuideLeveledList auto MiscObject Property Gold auto Event OnActivate(ObjectReference akActionRef) If akActionRef == game.GetPlayer() int MsgButton = 0 MsgButton = SteadingMenuMessage.Show() If !MsgButton Game.FadeOutGame(false, true, 2.0, 2.0) ObjectEnabled.enable() If !ObjectEnabled.IsDisabled() akActionRef.AddItem(DeedGuideLeveledList, 1, false) akActionRef.RemoveItem(Gold, 5000,false) Else ;something went wrong, maybe a notification here? Endif Endif Endif EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts