Sheathe not working right

My sheathe isnt working right

-- client
local animModule = require(game.ReplicatedFirst.ModuleScript)

local player = game:GetService("Players").LocalPlayer
local Animator = player.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
local tool = script.Parent

local loadedAnims = {}
local anims = 
{
	["Hold"] = tool.Animations:WaitForChild("Hold");
	["Sheathe"] = tool.Animations:WaitForChild("Sheathe")
}




tool.Equipped:Connect(function()
	loadedAnims.Hold = animModule.playAnim(Animator,anims.Hold,player)
	loadedAnims.Sheathe = animModule.playAnim(Animator,anims.Sheathe,player)
	loadedAnims.Sheathe:Play()	
	delay(anims.Sheathe.Lenght/2,game.ReplicatedStorage.ShowBo:FireServer(true))
	delay(anims.Sheathe.Lenght, loadedAnims.Hold:Play())
end)

tool.Unequipped:Connect(function()
	game.ReplicatedStorage.ShowBo:FireServer(false)
	loadedAnims.Hold:Stop()
end)
--server
local model = script.Parent.Parent.Parent
local primePart = model.PrimaryPart

local char
task.wait(1)
if model.Parent:IsA("Model") then
	char = model.Parent
end

model:SetPrimaryPartCFrame(char.HumanoidRootPart.CFrame)

local weld = Instance.new("Weld")
weld.Part1 = char.HumanoidRootPart
weld.Part0 = primePart
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0

local function RemoveBo()
	print("removing bo")
	local parts = model:GetChildren()
	
	for I,v in pairs(parts) do
		if not v:IsA("Script") then
			v.Transparency = 1
		end
	end
end

local function ReturnBo()
	print("returning bo")
	local parts = model:GetChildren()

	for I,v in pairs(parts) do
		print(v.Transparency)
		v.Transparency = 0
	end
end

game.ReplicatedStorage.ShowBo.OnServerEvent:Connect(function(_, boolean)
	print("fired")
	if boolean == true then
		print(true)
		RemoveBo()
	else
		print(false)
		ReturnBo()
	end
end)

It glitches out by completly making the the whole Tool transparent and not making visable no matter equiping it or not. Also its over all really bad it doesnt look good at all is there any way i can fix this. Also I havent scripted in a few years soo my script may be very bad

Screenshot 2022-05-04 194616
image

this is one case of it glitching out

I would give a video but im unaware on how to make one of the sheathing process

I dont really know how to make a sheathing process so if anyone one could enlighten me that would be great

Could you send the module script?

it doesnt really help but

local Animation = {}

function Animation.playAnim(Animator, anims, player)
	local loadedAnims = Animator:LoadAnimation(anims)
	loadedAnims.Priority = Enum.AnimationPriority.Action
	return loadedAnims
end

return Animation

To start of. Another way to disable the default roblox tool animation is to disable the RequiresHandle.

And do the animations play successfully?

if u dont cut them off yes

when i mean cut off i mean like u unequip when the equip anim is playing

do u know how to make videos of studio I think it would be helpful if i visualized the problem more

You could use gyaxo. Its a free software on the browser im pretty sure.

I will resume this tomorrow alr

I cant really give u a video but in the pictures it shows what happens when i equip very fast

I dont know how to make a proper sheathing script i havent scripted in a long time

now the tool itself doesnt work anymore every time its equiped it disapears I disabled all scripts and all of it disapears and then removes it self from iventory

i cant even describe how frustrating this is ive been trying to fix this one stupid problem for 4 days now and no progress only more problems

I Have a place which has a proper sheathing script, So you can re-do it based on that, Since im having a hard time understanding your code

Server:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEventsFolder = ReplicatedStorage:WaitForChild("RemoteEvents")
local Init_M6D = RemoteEventsFolder:WaitForChild("Init_M6D")
local Destroy_M6D = RemoteEventsFolder:WaitForChild("Destroy_M6D")

local function Init(player)
	
	local char = player.Character
	local a = char:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
	local m6d = Instance.new("Motor6D")
	m6d.Parent = char:FindFirstChild("Right Arm")
	m6d.Name = "RightGrip"
	m6d.Part0 = a.Part0
	m6d.Part1 = a.Part1
	m6d.C0 = a.C0
	m6d.C1 = a.C1
	a:Destroy()
	return m6d
	
end

Init_M6D.OnServerInvoke = Init

Destroy_M6D.OnServerEvent:Connect(function(player, M6D)
	
	M6D:Destroy()
	
end)

Client:

--Init
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEventsFolder = ReplicatedStorage:WaitForChild("RemoteEvents")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Animator  = Character:WaitForChild("Humanoid"):WaitForChild("Animator")
local Tool = script.Parent
local Equip_1 = script:WaitForChild("Equip_1")
local Equip_2 = script:WaitForChild("Equip_2")
local Slash_1 = script:WaitForChild("Slash_1")
Equip_1 = Animator:LoadAnimation(Equip_1)
Equip_2 = Animator:LoadAnimation(Equip_2)
Slash_1 = Animator:LoadAnimation(Slash_1)
local Init_M6D = RemoteEventsFolder:WaitForChild("Init_M6D")
local Destroy_M6D = RemoteEventsFolder:WaitForChild("Destroy_M6D")
local M6D

--Main?

Tool.Equipped:Connect(function(mouse)
	
	M6D = Init_M6D:InvokeServer()
	Equip_1:Play()
	Equip_2:Play()
end)

Tool.Unequipped:Connect(function(mouse)
	
	Equip_2:Stop()
	Destroy_M6D:FireServer(M6D)
	
end)

Tool.Activated:Connect(function()
	Slash_1:Play()
end)