Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to use Region3 with my custom stamper?

Asked by 7 years ago
local RbxStamper = LoadLibrary("RbxStamper")
local InsertService = game:GetService("InsertService")

local dispenser = game.workspace.Part
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local stampControl 
local pBase = nil

function findBase()
    for _, base in pairs(game.workspace["Building Zones"]:GetChildren()) do
        if base:IsA("Model") and base.Player.Value == player.Name then
            pBase = base            
        end
    end
end


function setupDragger()
    if pBase then
        stampControl = RbxStamper.SetupStamperDragger(dispenser,mouse,nil,Region3.new(?????)))
    else
        warn("Cannot find your building base.")
    end
end

function stamp()
        setupDragger()
        stampControl.Stamped.Changed:connect(function(value)
            stampControl.ReloadModel()
        end)
end

script.Parent.Equipped:connect(function()
    if not pBase then
        findBase()
    end
    stamp()
end)

script.Parent.Unequipped:connect(function()
    if stampControl then stampControl.Destroy() pBase = nil end
end)

The only thing i'm stuck on is using Region3 for the area to stamp in. How do you accomplish this?

Thanks.

Answer this question