ben446 Posted April 24, 2018 Share Posted April 24, 2018 Ok so scripting is not my strong point, I can read a script, but cant write one. I have a script that was put up in the modders resources section on this site. The script works perfect, but I want to alter the script and add something to it.The script is to buy a player house, as I say it does this as it should do. The problem comes when I try to make the script add a faction to the player when they buy the house. I want to do this as the house itself is on into own island on new land. it has a number or NPC's that do different things, ive got merchants guards farmers a lumber jack as well as a cook and a bard. ive set up a couple of new factions. one is its own crime faction, the other is a faction tying everyone on the island together, so every NPC on the island has DovahPorHomeFaction set. So I want it so when the player buys the house they too join this faction. Ive had a look and all I can find is a default script to change the player faction or add the faction to the player on load, but from the way I understand these scripts, they would add the player to the faction as soon as they activate the for sale sign, which would be ok if the player can buy the house, but if the player don't have the required gold then this would become an issue. Ive tried adding functions to the script, under the section of things added and done if the player purchases the house, ive used the wiki to find the functions and cant get it too work, so after trying for nearly 6 hours now, I thought if I reachout I may be able to get help with this problem. the script I have is this : Scriptname_001_SCRT_ForSale_Basic extends ObjectReference Key Property HouseKey01 Auto Book Property Deed01 Auto MiscObject Propery Gold001 Auto Int Property Cost Auto Message Property MainMenu AutoMessage Property NotEnoughCash AutoMessage Property Sold Auto Int AvailableCash Event OnActivate (ObjectReference obj) If obj == Game.GetPlayer()Int Button = MainMenu.Show() If Button == o ;Buy AvailableCash = Get.Player() GetItemCount(Gold001) If AvailableCash <Cost NotEnoughCash.Show() Else Game.GetPlayer().RemoveItem(Gold001, Cost, True) Game.GetPlayer().RemoveItem(HouseKey01,1,True) Game.GetPlayer()RemoveItem(Deed01, 1, True) Sold.Show() Self.Disable() EndIf EndIf EndIfEndEvent If someone could tell me what I need to add and where to get this script to work the way I want it too id be very grateful. I tried addint a function after the self.disable command before the endif but I couldn't get it too work, I took the function from the wiki page. Thank you all for reading this, the#ank you even more so if your able to help me. After 6 hours my head is starting to hurt, Bring back navmeshing lol Link to comment Share on other sites More sharing options...
ben446 Posted April 26, 2018 Author Share Posted April 26, 2018 ive managed to find another older thread on this site and with the help of people there ive managed to get this fixed. Link to comment Share on other sites More sharing options...
Recommended Posts