I’m trying to make these 2 scripts work for my game Spades of War and theres 2 problems.
- The left arm’s Z rotation is a little messed up after unequipping the tool
- The “Model.Metal” is below where I want it to be.
I tried changing the scripts alot and (sadly) had to use AI to try and figure out the issue but even it couldn’t fix it or it just messed it up. All I need to know is how to fix it and that’s that.
if it helps my character is a custom rig not an r15 or r6.
the local script
local Tool = script.Parent
local Track1 = Tool.Idle
local Idle = nil
Tool.Equipped:Connect(function(Mouse)
local Character = Tool.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")
Idle = Animator:LoadAnimation(Track1)
Idle:Play()
end)
Tool.Unequipped:Connect(function(Mouse)
if Idle then
Idle:Stop()
Idle = nil
end
end)
the server script
local Tool = script.Parent
local Weld = Tool:WaitForChild("Metal") --this is a motor6D btw, its how it was in the animation
local Metal = Tool.Model:WaitForChild("Metal") -- this is the actual Metal thing
Tool.Equipped:Connect(function()
local Character = Tool.Parent
local Pelvis = Character:WaitForChild("Pelvis") --my character isnt R15 nor R6 so that might be the problem but i believe its the script
Weld.Part0 = Pelvis
Weld.Part1 = Metal
Weld.Parent = Pelvis
end)
Tool.Unequipped:Connect(function()
Weld.Parent = Tool
end)