Local Script
local placementHandler = require(script:WaitForChild('PlacementModule'))
local base = workspace.Bases:FindFirstChild(player.Name)
local plane = placementHandler.new(base.Base, base.ItemHolder, 1)
ModuleScript
module.new = function(sentBase, obstacles, grid)
local plane = {}
plane.base = sentBase
plane.obstacles = obstacles
plane.position = sentBase.Position
plane.size = sentBase.Size
if (math.floor(.5 + plane.size.X/grid) % 2 == 0) then
plane.offsetX = -grid/2
else
plane.offsetX = 0
end
if (math.floor(.5 + plane.size.Z/grid) % 2 == 0) then
plane.offsetZ = -grid/2
else
plane.offsetZ = 0
end
plane.stateEvent = Instance.new("BindableEvent")
plane.stateChanged = plane.stateEvent.Event
plane.grid = grid
plane.enable = enablePlacement
plane.disable = disablePlacement
plane.rotate = rotate
plane.place = place
plane.setLoading = setLoading
return plane
end
I tried to only show what I believe is the important parts to the scripts. The problem I’m facing is atm I’m wanting to send multiple parts in the plane as the ‘Base’,
placementHandler.new(base.Base,…
base is the Model, and Base is a part. Now I want to let the purchase further plots in the future, but I don’t know how to make it to add another base to the plane. I tried just making the base part a lot larger and just putting parts ontop of it to prevent players from placing items on that part, put they still do (I’m trying to make a placement a system, like Sandbox, Theme park tycoon, etc.)
Any help or info would be appreciated