I'm trying to make it so when you jump and attack when you land it does more damage, how do I do this, I haven't tried because I have no idea where to start.
COMMUNITY QUESTION
How do I make critical hits that do more damage work?
1 answer
So to detect if a player has jumped you would get the Humanoid which has a function that returns true or false when the player jumps called Humanoid.Jump, with this you can detect if the player jumps to then change the value of the damage, here is a code I created that will detect if a player jumps -- More on Roblox Developers https://developer.roblox.com/en-us/api-reference/property/Humanoid/Jump.
game.Players.PlayerAdded:Connect(function(player) -- Will run when the player Joins
player.CharacterAdded:Wait() -- Will wait until the Character is there
while wait(.1) do
local Character = player.Character -- Gets the Character
local Humanoid = Character:FindFirstChild("Humanoid") -- Gets the Humanoid
if Humanoid.Jump then -- Will return a true or false value
print("Humanoid Jumped")
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
