I have code that breaks a weld from the player:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("CreatePartEvent")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button3Down:Connect(function()
if game.workspace.Values.have.Value == 1 then
game.workspace.Values.have.Value = 0
createPartEvent:FireServer()
player.Character.Weld:Destroy()
end
end)
I put button3down, it is wrong. How do you detect it??

10 comments
I believe it was called MiddleMouseButton, I'm not sure though
No it's not, it has to do something with user input.
First of all, use the UserInputService for receving input. You can do "if UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton3) then`.
then"*
That didn't work
Okay, use the InputBegan event and define a parameter named input. Then find if the UserInputType of the input was MouseButton3, then continue.
theres a .WheelForward event and a .WheelBackward event, but those fire if you roll the wheel not click it, so there's surely an Enum for the Middlebutton
ok Found it, it's called "MouseWheel", try that
https://developer.roblox.com/api-reference/enum/UserInputType
i don't have a mouse to test this xd xd so rip