So I'm making a script that Everytime you jump, your speed increases overtime until it falls.
Problem is, it's not detecting anything or changing the speed.
char=script.Parent
humanoid=char:FindFirstChildWhichIsA("Humanoid")
falling=false
humanoid.StateChanged:Connect(function(oldState, newState)
if newState == Enum.HumanoidStateType.Jumping then
if falling==false then
falling=true
repeat
humanoid.WalkSpeed=humanoid.WalkSpeed+0.05
wait()
until falling==false
end
elseif newState == Enum.HumanoidStateType.Landed then
if falling==true then
falling=false
humanoid.WalkSpeed=18
end
end
end)

2 comments
yes you do as they defined char as the parent of the script
mabey falling= true