Creating a bouncy ball/block, which bounces players into the air

I’m struggling to create a block, currently a ball/sphere which will bounce players who are walking or jump onto the block.

My script is;

while true do script.Parent.Velocity = script.Parent.CFrame.lookVector *200 wait(0) end

1 Like

Make a touched event, and check if it’s a player. If so, set their jump power to something high for a sec, force them to jump, and reset their jump power.

1 Like

How do I make a touched event? (Sorry, beginner scripter here).

1 Like

That’s ok, everyone’s a beginner at one point.

A touched event is:
(part).Touched:Connect(function(player)

end)

The player is the player, the part is the bouncy part, and the rest is somewhat self-explanatory.

2 Likes

Thanks, I’ll look up some scripting wiki pages and see what I can do.

1 Like

AlvinBlox also made a pretty in depth video on events. Check it out if you want.

3 Likes

This should work (place in a script inside the bouncy ball/part)

local touch = script.Parent
local force = 40 --how high

touch.Touched:Connect(function(plr)
	if plr then
		if plr.Parent:FindFirstChild("HumanoidRootPart") then
			local root = plr.Parent.HumanoidRootPart
			if root:FindFirstChild("JumpForce") == nil then
				local jump = Instance.new("BodyForce")
				jump.Force = Vector3.new(0,math.pow(force,2),0)
				jump.Parent = root
				plr.Parent.Humanoid.Jump = true
				wait(0.1)
				if jump and plr then
					jump:Destroy()
				end
			end
		end
	end
end)
4 Likes