I need urgent help please

Im honestly getting super tired of this so im going to explain this as much as i can.

BAASICALLY

  1. We wanted to make a balloon bounce pad which has a cooldown, we originally had two scripts for this, one for the balloon popping and doing the sound, and the other launching the player, we got it done, but its SUPER BUGGY
  2. the bug is basically you can pass through the balloon without jumping, and we wanted a type of it so it changes your jump power and makes you automatically jump when you touch the balloon instead of using whatever we’re using
  3. I tried using the JTOH KIT for this, it has a jump pad, problem is, it is completely incombatilblle using this, WE HAVE TWO SCRIPTS we tried to inject into this.

1- ClientObjectScript paired with a NumberValue of “Power”, Our way was to make a script to change the value power of “50” to “0” when the cooldown is on. Didn’t work.

2- Simple Velocity script for the part, didn’t work for some reason.

here was the clientobjectscript:

return function()
	local db = true
	local players = not script.Parent:FindFirstChild("IgnorePlayers")
	local boxes = not script.Parent:FindFirstChild("IgnoreBoxes")
	script.Parent.Touched:Connect(function(hit)
		if hit.Anchored == false and db == true and ((players and hit.Parent:FindFirstChild("Humanoid")) or (boxes and hit.Name == "Pushbox")) and not (script.Parent:FindFirstChild("Activated") and not script.Parent.Activated.Value) then
			db = false
			spawn(function()
				wait(0.05)
				db = true
			end)
			local bv = Instance.new("BodyVelocity")
			bv.MaxForce = Vector3.new(0, math.huge, 0)
			bv.Velocity = Vector3.new(0, script.Parent.Power.Value, 0)
			bv.Parent = hit
			game:GetService("Debris"):AddItem(bv,0.15)
		end
	end)
end

and heres the simple script:

script.Parent.Velocity = script.Parent.CFrame.UpVector * 900
script:Remove()

I tired so hard pairing all of these but it JUST DOESN’T WORK!

WHAT I WANT WORKING

  • Jump script without moving the body (The body automatically bouncing by itself like a trampoline.
  • Pairs with the other script of, cooldown functionality, balloon .touched and other stuff.
  • Literally just works

The first script

----- | Services | -----
local Players = game:GetService("Players")


----- | Variables | -----
WaitTime = 2
Debounce = false


----- | Method | -----
function onTouch(part)
		local Human = part.Parent:FindFirstChild("Humanoid")
		
		if Debounce then return end

		if Human then
			local Player = Players:GetPlayerFromCharacter(Human.Parent)
			
			Debounce = true
			script.Parent.Music:Play()
			script.Parent.Day.Enabled = true
			script.Parent.Transparency = 1

			task.wait(0.50)
		script.Parent.Day.Enabled = false
		script.Parent.JumpPad.Power.Value = 0
		script.Disabled = true

			task.wait(WaitTime)
		script.Parent.Parent.Transparency = 0
		script.Parent.JumpPad.Power.Value = 50
			script.Disabled = false	

			Debounce = false
		end
end


----- | Callback | -----
script.Parent.Touched:Connect(onTouch)

The script im trying to pair rn

return function()
	local db = true
	local players = not script.Parent:FindFirstChild("IgnorePlayers")
	local boxes = not script.Parent:FindFirstChild("IgnoreBoxes")
	script.Parent.Touched:Connect(function(hit)
		if hit.Anchored == false and db == true and ((players and hit.Parent:FindFirstChild("Humanoid")) or (boxes and hit.Name == "Pushbox")) and not (script.Parent:FindFirstChild("Activated") and not script.Parent.Activated.Value) then
			db = false
			spawn(function()
				wait(0.05)
				db = true
			end)
			local bv = Instance.new("BodyVelocity")
			bv.MaxForce = Vector3.new(0, math.huge, 0)
			bv.Velocity = Vector3.new(0, script.Parent.Power.Value, 0)
			bv.Parent = hit
			game:GetService("Debris"):AddItem(bv,0.15)
		end
	end)
end

image
image

So is your issue that the code just doesn’t run sometimes?
Also, please rename the post to fit your needs (example: “Trampoline script not working”)

yeah basically, well not sometimes, straightout breaks. the launch script is the one thats breaking, i want to to work with the other script

While I can’t just make a whole script for you, here’s an idea for fixing any collision detection issues:

Part.Touched is unreliable, especially if the subject isn’t exactly walking, so you can use workspace:GetPartsInPart to get the characters surrounding a part, whether it be through a whitelist using overlapParams or filtering it in a loop.

Now, using GetPartsInPart constantly (every 0.05 seconds) on the client to see if the player is near the balloon should work, but to increase reliability of the script you may want to increase the hitbox of the balloons.
^ I highly suggest using overlapParams and only accepting the client’s character in a whitelist, that way if you ever get any kind of result from GetPartsInPart you’ll know it’s from the player.

Be ware!!! This can be incredibly laggy if implemented poorly! Here’s a method to potentially optimize it:

If you’re going for a staged-based game, you can load and unload active objects (such as the bouncy balloons) whenever the player enters and leaves a stage, or you can enable the script for them whenever the player gets close.

Additional note: use the task library for spawn and wait, it’s generally just better