How to make it so this script enables and disables a jumping block

Hello! Im trying to make a button that enables a jumping block I made, but the issue is that whithout having to touch the Button you can still go on the jumping block/bounce pad and bounce up to the telaporter, heres the scripts.

Button Script

local Button13 = script.Parent
local JumpPart1 = workspace:WaitForChild("JumpPart1") -- change location if wrong
local ButtonActivatingPart13 = workspace:WaitForChild("ButtonActivatingPart13")
local Jumper = workspace.JumpPart1.Jumper
local debounce = false

local function PressedButton()
	if not debounce then
		debounce = true
		-- activates the part
		Button13.BrickColor ="Lime green")
		ButtonActivatingPart13.Transparency = 0.5
		ButtonActivatingPart13.CanCollide = false
		JumpPart1.Transparency = 0.1
		Jumper.Disabled = false


		-- deactivates the part
		ButtonActivatingPart13.Transparency = 0
		ButtonActivatingPart13.CanCollide = true
		JumpPart1.Transparency = 0.7
		Jumper.Disabled = true
		Button13.BrickColor ="Dark stone grey")
		debounce = false

Button13.Touched:Connect(PressedButton) -- triggers the function in the parentheses when touched

Jumping Script

local DB = false

	if hit.Parent:FindFirstChild("Humanoid") and not DB then
		DB = true

		local humanoid = hit.Parent.Humanoid --No need to reference it again, as you've already checked for it
		humanoid.JumpHeight = 100
		humanoid.Jump = true
		humanoid.JumpHeight = 7.2
		DB = false

I believe disabling the CanTouch property of a part makes it so that Touched events do not fire.

(Edit: this may cause the script to error, though.)

1 Like

accidently clicked the solution button

why would it disable it tho?

Because that’s what the purpose of the property is. You can read about it here: New Part Collision Property: CanTouch [ACTIVATED]