I’ve been making this script(specifically for a diving board) that when you land after jumping, it fires an event. It works relatively ok most of the time but it has one major flaw with it: You can walk off an edge and it considers it as if it has jumped. I was wondering if there was a better way to detect whether they actually jumped or not. Other information : The game also uses the classic jump delay script, so I can’t have it check for spacebar input to judge whether they actually jumped Here is the code I currently use.
local hasJumped = false
local h=script.Parent:WaitForChild("Humanoid")
h.Changed:connect(function(prop)
if prop and prop== "Jump" and humanoid.Jump == true and hasJumped ~= "A" then
print("cool")
hasJumped = true
elseif humanoid:GetState() == Enum.HumanoidStateType.Landed and hasJumped == true then
print("FELL")
hasJumped = "A"
game.ReplicatedStorage.Bounce:FireServer()
wait(.5)
hasJumped = false
end
end)