I’ve tried several ways to do this, but the closest I got was this. I have to trigger Unequip twice in order for it to work, but on the first try it doesn’t work. Also, the broom/tool can still be pushed and the other parts can still spin/move when welded to the handle.
Condition: No anchoring the parts as it breaks the ConstraintWelds
1st Trigger:
2nd Trigger:
local broom = script.Parent
local unequipPrompt = broom.Head:WaitForChild('UnequipPrompt')
local equipPrompt = broom.Shaft:WaitForChild('EquipPrompt')
local ridePrompt = broom.Shaft:WaitForChild('RidePrompt')
local leavePrompt = broom.Shaft:WaitForChild('LeavePrompt')
broom.Owner.Value = broom.Parent.Parent.Name
unequipPrompt.Triggered:Connect(function(player)
local character = player.Character or player.CharacterAdded
local humanoid = character:FindFirstChild('Humanoid')
if humanoid then
broom.Parent = game:GetService('Workspace')
broom:WaitForChild('Handle').CFrame = character:WaitForChild('HumanoidRootPart').CFrame * CFrame.new(Vector3.new(-1, 0, -5))
broom:PivotTo(broom:GetPivot() * CFrame.Angles(math.pi * -0.5, 0, math.pi * 0.5))
local attachment = Instance.new('Attachment')
attachment.Parent = broom.Handle
attachment.Position = Vector3.new(0, 0, 0)
local attachment2 = Instance.new('Attachment')
attachment2.Parent = broom.Handle
attachment2.Position = Vector3.new(0, 0, 0)
for index, value in broom:GetChildren() do
if value:IsA('Part') or value:IsA('UnionOperation') then
--value.Anchored = true
--local linearVelocity = Instance.new('LinearVelocity')
--linearVelocity.Parent = value
--linearVelocity.MaxForce = math.huge
--linearVelocity.VectorVelocity = Vector3.new(0, 0, 0)
--local linearVelocity = Instance.new('LinearVelocity')
--linearVelocity.Parent = value
--linearVelocity.MaxForce = math.huge
--linearVelocity.VectorVelocity = Vector3.new(0, 0, 0)
--linearVelocity.Attachment0 = attachment
end
end
--local linearVelocity = Instance.new('LinearVelocity')
--linearVelocity.Parent = broom.Handle
--linearVelocity.MaxForce = math.huge
--linearVelocity.VectorVelocity = Vector3.new(0, 0, 0)
--linearVelocity.Attachment0 = attachment
--local alignPosition = broom:WaitForChild('Handle').AlignPosition
--alignPosition.Attachment0 = attachment
--local alignOrientation = broom:WaitForChild('Handle').AlignOrientation
--alignOrientation.Attachment0 = attachment2
local startPosition = broom:WaitForChild('Handle').CFrame
broom:WaitForChild('Handle'):GetPropertyChangedSignal('CFrame'):Connect(function()
broom:WaitForChild('Handle').CFrame = startPosition
end)
broom:WaitForChild('Handle').Anchored = true
unequipPrompt.Enabled = false
equipPrompt.Enabled = true
ridePrompt.Enabled = true
end
end)