Old Post < O L D >

Support no longer needed

3 Likes

@ultra_txm You can make a script and region3, then check if the mouse is pointing into the correct area and if it is true then you can’t build anything else or make a gui that says you can’t build here or anything else. Hope it helps you.

1 Like

I tried to create a script (I haven’t tested it) and I got this:

 [[Script]]
--Script Parent is the Character of the Player, then place it into the StarterCharacterScripts
game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(Player)
local Found = false
local region = Region3.new(Vector3.new(0, 0, -3), Vector3.new(4, 4, 4)) --You can choise here the size of the Region/ Scripting Zone
local res = 4
--region = region:ExpandToGrid(res) --Align it to the Grid
local parts = workspace:FindPartsOnRegionWithWhite(region, script.Parent:GetDescendants())
for _,part in pairs (parts) do
    if part:FindFirstAncestor(Player.Name) then
        Found = true
        break
    else
        Found = false
    end
end
return Found
end

 [[LocalScript]]
local F3X = YourTool
F3X.Activated:Connect(function()
    local Checker = game.ReplicatedStorage.RemoteFunction:InvokeServer(game.Players.LocalPlayer)
    if Checker == true then
        print("Player is in the Scripting Zone, he can build.")
    else
        print("Player is not in the Scripting Zone, he dont can build.")
    end
--Now i will be show you how it should used, DONT INCLUDE THIS IN YOUR SCRIPT, IT IS ONLY FOR SHOW!!!
[[--
--    local function Build(Boolean)
--This should your Build Function.
     -- if Boolean == true then
        --Do your BuildingScript
     -- else
        --Do nothing or you can make a script that show the Player that he dont is in the Scripting Area or something else.
   --  end
-- end    

--  local F3X = YourTool
--    F3X.Activated:Connect(function()
    -- local Checker = game.ReplicatedStorage.RemoteFunction:InvokeServer(game.Players.LocalPlayer)
   -- Build(Checker)
 --end)
--]]
1 Like

@ultra_txm, I finished it, let me know if it worked. I hope this. Help you.

1 Like

Thank you so much! Really appreciate it.

1 Like