The .Jumping event means that the npc is already jumping. To achieve what you need, you’d have to modify the code of the npc.
For example, you might want to create a function called Jump, which would look something lile this:
function Jump(humanoid: Humanoid)
task.delay(1, function()
humanoid:Jump()
end)
end
And you’d call that function instead of directly calling humanoid:Jump() in the code.
@hannes213 Did a good job explaining the issue, but I’ll explain further to hopefully allow you to understand how it works.
The .Jumping event means that the npc is already jumping. To achieve what you need, you’d have to modify the code of the NPC.
Basically, if you use .Jumping that means that the NPC has already jumped, but using function jump() will allow you to delay the jump,
function Jump()
task.wait(1)
humanoid.Jumping = true
end
After you have defined this function, call Jump() when you need the NPC to jump.
Example code:
local character = script.Parent -- Character (set to character you want)
local humanoid = character.Humanoid -- (The Character humanoid)
function Jump() -- Define Jump()
task.wait(1) -- Wait 1 second
humanoid.Jumping = true -- Set Jumping to true
end
Jump() -- call Jump() when you want the NPC to jump
i thought about that but it works only the first time, in a loop that will make it jump immidiatly after the second turn, or it might pause the entire script if i do it with pathfinding server
could try something like this just set the attribute on the humanoid you could even change this to attribute on the npc model etc…
humanoid:GetAttributeChangedSignal('Jump'):Connect(function()
if humanoid:GetAttribute('Jump') then
humanoid:SetAttribute('Jump', nil)
task.wait(1)
humanoid.Jump = true
end
end)
humanoid:SetAttribute('Jump', true)
should work with loops and you can tag it from any script thats on server or client depending on which you have the jump script on