Hiya! I’m glitchifyed and I’ve made this sandbox tycoon placement module for those who don’t want to modify Tunicus’ original placement module themselves.
This module works great for sandbox tycoons, which is a genre which originated from the hit tycoon game, Miner’s Haven! The Miner’s Haven open source has a placement module that behaves very similarly to this one.
Please be aware this is an updated version of Tunicus’ placement module that he made open source back in 2017. It has been ‘modernised’ with more features, such as:
Here are the modifications I have made to the module:
- Objects with customisable adjustable heights (hydraulics)
- Objects that can be placed on top of (platforms)
- You can place on top of multiple of these platforms at once
- Hydraulic items can have legs that automatically size themselves to stand on the ground
- The grid texture now has an option to fade in/out and has a custom colour
- There are customisable SelectionBoxes that will go on any item you’re currently placing and obstacles while you’re placing
- A setting to hold the place button down to continue placing
- An option to stop items from wobbling around when moving the mouse while placing
- An option to hide CoreGui while placing
- Easily customisable keybinds that also support Xbox controls
Settings:
// PLACEMENT SETTINGS
bool INTERPOLATION -- whether placement smoothing is enabled
bool WOBBLE_ITEMS -- whether items wobble when moving (does nothing if interpolation is false)
float INTERPOLATION_DAMP -- how fast smoothing is, make it a value [0, 1]
float ROTATION_SPEED -- rotation tween speed in seconds
float PLACEMENT_COOLDOWN -- how quickly the user can place (minimum time in seconds between placing items)
bool HOLD_TO_PLACE -- if the user can hold the place key to place
// PLACEMENT COLORS, TRANSPARENCY, FADING
Color3 COLLISION_COLOR3 -- color of the hitbox when object collides
float COLLISION_TRANSPARENCY -- transparency of the hitbox when object collides
Color3 NORMAL_COLOR3 -- color of the hitbox
float NORMAL_TRANSPARENCY -- transparency of the hitbox
Color3 LOAD_COLOR3 -- color of the hitbox when loading
float LOAD_TRANSPARENCY -- transparency of the hitbox when loading
float HIT_BOX_FADE_TIME -- primarypart/selection box fade time in seconds. set to 0 to instantly change/appear
// SELECTION BOXES
float SELECTION_BOX_TRANSPARENCY -- selection box transparency. set to 1 for no selection boxes
Color3 SELECTION_BOX_COLOR3 -- selection box color. set to nil for a custom color system (you have to code that yourself)
float SELECTION_BOX_PLACING_THICKNESS -- selection box thickness on objects the user is placing
float SELECTION_BOX_OBSTACLE_THICKNESS -- selection box thickness on obstacles
// GRID SETTINGS
string GRID_TEXTURE -- texture of the grid space, set to nil if you don't want a visible grid
Color3 GRID_COLOR3 -- color of the grid texture
float GRID_TRANSPARENCY -- the transparency of the grid while placing
float GRID_FADE_TIME -- the amount of seconds that the grid takes to fade. set to 0 to instantly appear
bool TEXTURE_ON_PLATFORMS = true -- if the grid texture is also put on platforms
// CONTROLS
bool OVERRIDE_CONTROLS -- whether the keybinds below work or not
int INPUT_PRIORITY -- input priority of default controls
list PLACE_KEYBINDS -- placement keybinds (pc, xbox)
list ROTATE_KEYBINDS -- rotate keybinds (pc, xbox)
list HYDRAULIC_UP_KEYBINDS -- hydraulic up keybinds (pc, xbox)
list HYDRAULIC_DOWN_KEYBINDS -- hydraulic down keybinds (pc, xbox)
list CANCEL_KEYBINDS -- cancel placement keybinds (pc, xbox)
// CORE GUI
list CORE_GUI_DISABLE -- core gui to disable when placing
License:
This module is under the MIT license which means you are allowed to freely use this for commericial and private use, modify it, and distribute it as you please.
Credits/attributions:
You don’t have to credit I or Tunicus, but credit would be greatly appreciated. We both put many many hours into this just to give it away to the community for free.
Also, here’s the link to the original module that I’ve modified: Placement Handler V2
Possibilities for the future:
- Multiple hitboxes per object when placing
- Wall/ceiling placement
- Withdrawal/moving system
- Inventory system
- Shop system
- Tutorial post on the forums going in depth on how to use the module
- Video tutorial on how to use the module
You can add the module to your inventory here:
Roblox module (doesn’t have server-sided placement protection)
You may use this test place to see how the module works:
Github page (rbxl place file with server-sided placement protection)
Also, the module script itself doesn’t handle the actual placement of the models, only the placement preview of the models. I have however provided a .rbxl file in the Github that contains an example of server-sided placement code that does actually place the models down.
I have also made a module that allows you to calculate numbers past the limits of Roblox numbers. If you are interested, see this post on the Dev Forum here: UltiNum v1.0 Extended Number Module
July 2024 status update:
I have been at work creating the next iteration of this module. This new module is going to take some time, but it’s already at a great start! It’s going to feature improved platform placement, optimised collision detection, more settings, and even multi-hitbox placement!
Multi-hitbox placement will allow you to specify multiple hitboxes inside a single item, which can prove incredibly useful!
Disclaimer: This new module is going to be a lot more difficult to use in a project, due to the very nature of how I’m writing it. It is not made to handhold people, but rather it’s going to be more for power-users who want to customise the placement visuals and such withouit having to directly modify the module. This includes the hitbox visuals, leaving displaying collisions between items entirely up to the developer!
The new module will still continue to pivot the models during placement and smooth them, with all-new smoothing types such as elasticity!
I will personally make sure it is as accessible as possible, so much so that I am planning on providing even VR devices a great experience.