Function Main(Player As Long, Message As String) As Long Dim A As Long Dim DoorX As Long, DoorY As Long, Flag As Long, Token As Long, Map1 As Long, Map2 As Long, Map3 As Long, Buycost As Long, SellCost As Long '''''''''''''''''''''''''''EDIT THIS''''''''''''''''''''''''''''' Map1 = 77 'Whats the Map with the front door Map2 = 5000 '2nd Room of house (For Evict) Map3 = 5000 '3rd Room of house (For Evict) DoorX = 5 'The X Location of the front door DoorY = 9 'The Y Location of the front door Flag = 100 'Flag to be used for house (Occupies or Vacent) Token = 200 'The Object number of the house deed Buycost = 80000 'Ammount Of Money needed to Purchase the House SellCost = 10000 'Ammount Of Money refunded from selling the house ''''''''''''''''''''''DO NOT EDIT BELOW THIS''''''''''''''''''''' If StrCmp(Message, "Buy House") Then If GetFlag(Flag) = 0 Then If HasObj(Player, 1) >= Buycost Then Playermessage(Player, "Say OPEN to open your front door", YELLOW) SetFlag(100, 1) 'Tellin Us The House has been Bought TakeObj(Player, 1, BuyCost) GiveObj(Player, Token, 1) PlayerMessage(Player, "You have purchased the deed to the house", yellow) MapMessage(Map1, StrCat(GetPlayerName(Player), " has purchased the house"), Yellow) Else PlayerMessage(Player, StrCat3("You Do not Have ",Str(BuyCost), " gold"), yellow) End If Else Playermessage(Player, "This house is already Owned", yellow) End If End If If StrCmp(Message, "Sell House") Then If HasObj(Player, Token) Then TakeObj(Player, Token, 1) MapMessage(Map1, StrCat(GetPlayerName(Player), " has sold his house"), YELLOW) SetFlag(Flag, 0) Playerwarp(Player, Map1, DoorX, DoorY+1) GiveObj(Player, 1, SellCost) PlayerMessage(Player, StrCat3("You recieve ",Str(SellCost), " gold for selling your house."), yellow) Else PlayerMessage(Player, "You do not own this house!", YELLOW) End If End If If StrCmp(Message, "Open") & HasObj(Player, Token) Then Opendoor(Map1,DoorX,DoorY) MapMessage(Map1, StrCat(GetPlayerName(Player), " has opened the front doors"), YELLOW) End If If StrCmp(Message, "Evict") & HasObj(Player, Token) Then For A = 1 To GetMaxUsers() If getplayermap(a) = Map1 | getplayermap(a) = Map2 | getplayermap(a) = Map3 then PlayerMessage(a,"You have been evicted from the house", white) PlayerWarp(a, Map1,DoorX,DoorY+1) End If Next A End If Main = Continue End Function