I am trying to do a jump script that when my character jumps, It will play a different animation if I am holding the specific tool. But I have been struggling to do that as most stuff did not work
local function checkAirborne()
if equipped then
if humanoid.FloorMaterial ~= Enum.Material.Air then
JumpAnim:Stop()
end
end
end
humanoid.Jumping:connect(function(jump)
if equipped then
JumpAnim:Play()
end
end)
while true do
checkAirborne()
wait(0.1)
end
The script can detect if I am not in the air (On the ground) but It cannot detect when it jumps, can someone help?