So currently i have this robot as my custom character named StarterCharacter. Whenever i try to weld the tool to the custom character, the tool just falls down and doesnt weld, plus all the animations also dont work, but give no error .Any way to fix this?
script for tool:
script.Parent:FindFirstChild("Handle"):Destroy()
script.Parent.Equip.OnServerEvent:Connect(function()
local char = script.Parent.Parent
if char:IsA("Model") then
if not char:FindFirstChild("Handle") then
local rHand = char:FindFirstChild("RightPalm")
h.CFrame = rHand.CFrame * CFrame.new(0,0,-1.75)*CFrame.Angles(-math.rad(180),0,math.rad(180))
local weld = Instance.new("Weld")
weld.Part0 = rHand
weld.Part1 = h
weld.C0 = rHand.CFrame:inverse() * rHand.CFrame
weld.C1 = h.CFrame:inverse() * rHand.CFrame
weld.Name = 'HandleWeld'
weld.Parent = rHand
h.Parent = char
end
end
end)
local Tool = script.Parent
local Animation = Tool.Animation
Tool.Activated:Connect(function()
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
end)