How to Make a House Buying and Locking System 🟨

Needed Devices:

(per house)
1x Vending Machine
2x Teleporters
3x Buttons
1x Property
2x Item Granter (or any other device with a block option)
2x Overlays
2x Relays

Introduction

In this guide I will be showing you how to make a system where players can buy a house, and then the owner of the house will have a button when they enter the house to lock or unlock the house. If they lock it, other players will not be able to go to the house. If the owner unlocks it, then all players can go to their house.
There probably will be things I did that were unnecessary and could be simplified, but this is the Coolian way, and this is just how I made it.

The Buying System

Place down a vending machine, and set it to transmit on channel. This is how the player is going to buy the house. Make it cost as much as you want the house to cost, with the item the player needs to buy it (I made it cash). You can also add an item description, where you would describe the house (in my game, there are multiple options of houses to buy, so descriptions of each house is needed to help the player decide which to purchase). You can also make the vending machine not visible in game, and replace it with a sign signaling the house. Lastly, make the vending machine deactivate when purchased. The settings should look like this (some of this is customization, so yours can be a little different):


Screenshot 2023-08-04 18.17.26
image

Next, place down two teleporters, and a button. The way this system works, is the owner presses a button, and that button teleports them to the house.
Button Settings: Make the button message something like “Go Home”, and make the button Not Visible on Game Start, Not Active on Game Start, and set the Active Scope to Player. Hopefully you can figure that out without having a picture of the settings.
Teleporters: Place one teleporter at the house, and another at the vending machine. Make the vending machine teleporter teleport to the house teleporter. The only setting you should have to change (other than the teleporter groups of course) is making the teleporters not visible in game.
Wires: Connect a wire from the vending machine to the button. When item purchased → Activate button. Finally, connect a wire from the button to the teleporter that teleports to the house. When button is pressed → Teleport player to target.

Next, place down a property and an item granter.
Name the property “House Owner” and make it a number property.
The item granter is only used for a block, if you prefer using a different device for blocks, you can change that, but item granters are low memory so I used one. Open a on wire pulse block, and make it look like this:
image
Important, read on if all players in your game aren’t on separate teams: This works in my map because all players are on separate teams. If all players aren’t on separate teams, there is a simple fix. Simply change the Triggering Player’s Team Number block to a Triggering Player’s Name block. And, make sure to make the property House Owner a Text Property. There is one more change later in the guide, and I will signal to do so when that comes up.

And one more wire, a wire from the vending machine to the item granter. When item purchased → Run Wire Pulse.

The Lock/Unlock System

Place down a device with a block option (I used item granter), and place it next to the teleporter in your house. Connect a wire from the teleporter to the device.Player teleported here → Run wire pulse block.
Then make a on wire pulse block inside your device, and make it look like this:
image
**And if you used the Triggering Player’s Name block before, when setting the property, also change this block to a Triggering Player’s Name block.
The purpose of this block is that it only sends a channel if the player is the person who bought the house.

Now, place down two Overlay devices. Make them both button overlays, not visible on game start, and set all scopes to player. Here is where they are different. Make one unlock and one lock. Make them both send on the opposite channels when being clicked, and hide when being clicked. I know that was very confusing, so here are pictures of what they should look like.
First overlay, the Lock overlay:
Screenshot 2023-08-05 19.18.39
Screenshot 2023-08-05 19.19.06
image

Second overlay, the Unlock overlay:
Screenshot 2023-08-05 19.21.21
Screenshot 2023-08-05 19.21.35
image

Hopefully you managed to put all of those settings in. Essentially, when you press on the lock button, it sends on channel lock and shows the unlock overlay. When you press on the unlock button, it sends on channel unlock and shows the lock overlay.

One more thing: Hiding the overlays. For my system the Lock/Unlock buttons are only available inside the house, so when they leave the button disappear. For my house how players leave is by pressing a button that teleports them out, so wire the button to both overlays: Button pressed → Hide overlay (x2).

Now, go back to your vending machine area. Place down two more buttons next to the “Go Home” button. We’re going to keep them separate for now as we edit the settings and wire them up, but at the END of the guide, place all buttons directly on top of each other (gridlock recommended).
These are going to be the buttons everyone other than the house owner sees. Make both buttons not visible in game, not active on game start, and set Active Scope to player. Now make one say “House Locked!”, and deactivate when receiving on unlock. Make the other one say “Go to House”, and deactivate when receiving on lock 1. Button setting pictures:
First button, the House Locked button:


Second button, the Go to House button:


Great, now place down two relays. Make them both All Other Players. However, make one relay when receiving on “lock 1”. Make the other relay when receiving on “unlock”.

Finally, the wires. There are quite many, so make sure to read carefully.
Wire from the vending machine to the “lock 1” relay. Item purchased → Trigger Relay.
Wire from the “lock 1” relay to the “House Locked!” button. Relay Triggered → Activate button.
Wire from the “lock 1” relay to the “Go to House” button. Relay Triggered → Deactivate button.
Wire from the “unlock” relay to the “House Locked!” button. Relay triggered → Deactivate button.
Wire from the “unlock” relay to the “Go to House” button. Relay triggered → Activate button.
Wire from the “Go to House” button to the teleporter that teleports to the house. Button pressed → Teleport player to target.

Summary

And that should be it for my house buying and locking system! Now a player is able to buy a house, and they can unlock the house, opening to all other players, and lock it, closing it again to all other players. This is all for one house, so if you want another house option, you will have to copy everything. It might seem like a lot, but if you just copy everything all you have to do is change the names of the channels and re-wire everything.
If you liked this guide a :heart: would be much appreciated, and have fun!

What Difficulty Should This Guide Be?
  • 0/10 or :white_large_square:
  • 1/10 or :blue_square:
  • 2/10 or :green_square:
  • 3/10 or :green_square:
  • 4/10 or :yellow_square:
  • 5/10 or :yellow_square:
  • 6/10 or :orange_square:
  • 7/10 or :orange_square:
  • 8/10 or :red_square:
  • 9/10 or :red_square:
  • 10/10 or :purple_square:
  • 11/10 or :black_large_square:
0 voters
15 Likes

First like!

3 Likes

Second Like

4 Likes

Nice guide, @Im_Pretty_Cool, but…

2 Likes

It’s a very good point. Other than it sounding cool, I did it to show that it was my way of making it, as I stated, there are probably things I show in the guide that can be simplified.
Also just a part of it was everyone seemed to be doing it even when there wasn’t another guide made of it yet, but I do agree it is mostly unnecessary.

5 Likes

It just makes it confusing for any new users coming to the forum. (Also, I noticed you kept it?)

1 Like

I agree (and I am going to change it, I’m just currently working on another edit for this guide. When I finish the section and edit it as a whole it’ll be gone).

3 Likes

The guide is finally finished!

3 Likes

Bump.

2 Likes

Nice Guide!!

1 Like

Thanks!

2 Likes

bump

yas
many month bump

1 Like

nice fresh checkbox reusable bump