Roblox Script make the Humanoid jump automatically
Posted on May 1, 2020
To make the Humanoid jumps on touching a Part, it's pretty straightforward:
local function onTouch(part)
local humanoid = part.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.Jump = true
end
end
script.Parent.Touched:Connect(onTouch)
If we want to affect the JumpPower
just for this automatic jump:
local function onTouch(part)
local humanoid = part.Parent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.JumpPower = 200
humanoid.Jump = true
wait(1)
humanoid.JumpPower = 50
end
end
script.Parent.Touched:Connect(onTouch)