Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Animations?

Asked by 9 years ago

Please try to understand this, I'll try to explain it as best as I can...

So I have a script that when a tool is equipped, it plays an animation, and when the tool is unequipped, the animation stops. This script is working perfectly fine...

local tool = script.Parent local animation = script.Animation local player = game.Players.LocalPlayer

local animationtrack

tool.Equipped:connect(function() local character = player.Character local humanoid = character:WaitForChild("Humanoid") animationtrack = humanoid:LoadAnimation(animation) animationtrack:Play() end)

tool.Unequipped:connect(function() animationtrack:Stop() end)

but the tool I have is a custom made tool and at first I only had the handle, but then I wanted to weld in another part so there would be two parts in the tool. Here's my weld script...

local tool = script.Parent

tool.Equipped:connect(function() local weld = Instance.new("Weld") weld.Parent = tool weld.Part0 = tool:FindFirstChild("Handle") weld.C0 = CFrame.new(0,0,0) weld.Part1 = tool:FindFirstChild("PartZ") weld.C1 = CFrame.new(0,-2,0) end)

However, this script must have something wrong with it because now when i unequip the tool, the animation doesn't stop playing and the character stays in the position of the animation. Does anyone now why? If so what can I do to fix this????

0
may you fix your formatting plz koolkid8099 705 — 9y

Answer this question