I have these 2 scripts that are trying to divide a part on where the player clicks however currently SubtractAsync does absolutely nothing
client:
local mouse = game.Players.LocalPlayer:GetMouse()
local mouseStatus = "Up"
mouse.Button1Down:Connect(function()
mouseStatus = "Down"
end)
mouse.Button1Up:Connect(function()
mouseStatus = "Up"
end)
game["Run Service"].RenderStepped:Connect(function()
if mouseStatus == "Down" then
local hit = mouse.Hit
if mouse.Hit and mouse.Target:IsDescendantOf(game.Workspace.Folder) then
game.ReplicatedStorage.RemoteEvent:FireServer(mouse.Hit, mouse.Target, mouse.TargetSurface)
end
end
end)
server:
local normals = {
["Enum.NormalId.Right"] = Vector3.new(0,90,0),
["Enum.NormalId.Back"] = Vector3.new(0,180,0),
["Enum.NormalId.Left"] = Vector3.new(0,-90,0),
["Enum.NormalId.Top"] = Vector3.new(90,0,0)
}
game.ReplicatedStorage:WaitForChild("RemoteEvent").OnServerEvent:Connect(function(player, hit, target, normal)
local newPart = Instance.new("Part")
newPart.Position = hit.Position
newPart.Anchored = true
newPart.Size = Vector3.new(0.1,0.1,5)
newPart.Parent = game.Workspace
if normals[tostring(normal)] then
newPart.Orientation += normals[tostring(normal)]
end
local newUnion = target:SubtractAsync({newPart})
newUnion.Anchored = false
newPart:Destroy()
end)
Ok so it does work however what i wanted it to do was simply slice off the part where you see my mouse is going which it does actually do the new parts have a hole in them where my mouse was but also as you can see a bunch of unions get added which i dont want
sorry for how short the video is im recording in 1440p and if it is long roblox doesnt let me post