how do i make this when the player jumps the animation will stop
heres the code
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
if script.Parent.slots and script.Parent.slots:IsA("Frame") then
local children = script.Parent.slots:GetChildren()
for _, child in pairs(children) do
if child:IsA("Frame") then
local buttonchildren = child:GetChildren()
for _, button in pairs(buttonchildren) do
if button:IsA("TextButton") then
button.MouseButton1Click:Connect(function()
humanoid:LoadAnimation(button.Parent.config.animation):Play()
humanoid.WalkSpeed = 3
button.Parent.music:Play()
end)
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if humanoid.Jump == true then
humanoid.WalkSpeed = 16
button.Parent.config/animation:Stop()
button.Parent.config.music:Stop()
end
end)
end
end
end
end
end
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
if script.Parent.slots and script.Parent.slots:IsA("Frame") then
local children = script.Parent.slots:GetChildren()
for _, child in pairs(children) do
if child:IsA("Frame") then
local buttonchildren = child:GetChildren()
for _, button in pairs(buttonchildren) do
if button:IsA("TextButton") then
local animation = button.Parent.config.animation
button.MouseButton1Click:Connect(function()
humanoid:LoadAnimation(animation):Play()
humanoid.WalkSpeed = 3
button.Parent.music:Play()
end)
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if humanoid.Jump == true then
humanoid.WalkSpeed = 16
animation:Stop()
end
end)
end
end
end
end
end
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
if script.Parent.slots and script.Parent.slots:IsA("Frame") then
local children = script.Parent.slots:GetChildren()
for _, child in pairs(children) do
if child:IsA("Frame") then
local buttonchildren = child:GetChildren()
for _, button in pairs(buttonchildren) do
if button:IsA("TextButton") then
local animation = button.Parent.config.animation
button.MouseButton1Click:Connect(function()
local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()
humanoid.WalkSpeed = 3
button.Parent.music:Play()
end)
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if humanoid.Jump == true then
humanoid.WalkSpeed = 16
animationTrack:Stop()
end
end)
end
end
end
end
end