Jump pad ain't jumping

I’m trying to script a decently high quality jump pad. However, it doesn’t make the player go up at all. Everything in the script works perfectly except for the line that makes the player go up. Nothing in the dev console, and no overriding scripts.

local me = script.Parent
local service = game:GetService("TweenService")
local debounce = false
local beep = me["500 Hz Beep / Error Sound (Loopable)"]

local function chime(note1, note2, note3)
	beep:Play()
	beep.PlaybackSpeed = note1
	task.wait(0.1)
	beep.PlaybackSpeed = note2
	task.wait(0.1)
	beep.PlaybackSpeed = note3
	task.wait(0.1)
	beep:Stop()
end
	
me.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local hum = hit.Parent:FindFirstChild("Humanoid")
		if hum:IsA("Humanoid") then
			if debounce == false then
				debounce = true
				
				local hrp = hum.RootPart
				hrp.AssemblyLinearVelocity = hrp.CFrame.UpVector * 50
				me.Dash:Play()
				me.Color = Color3.new(1,0,0)
				
				local tween = service:Create(me, TweenInfo.new(0.5, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out), {Position = me.Position + Vector3.new(0,0.5,0)})
				tween:Play()
				task.wait(3)
				
				tween = service:Create(me, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Position = me.Position + Vector3.new(0,-0.5,0)})
				tween:Play()
				me["Steam Piston Pump 32 (SFX)"]:Play()
				tween.Completed:Wait()
				
				chime(0.31, 1, 1.65)
				me.Color = Color3.new(1,1,0)
				debounce = false
			end
		end
	end
end)

2 Likes

Did you use a server script? On my side, this script is working.

2 Likes

Is the script inside the character?

2 Likes

Yes, I put the local script in StarterPlayerScripts. It gets copied into the character.

2 Likes

It worked like this.

1 Like

I don’t think the server has control over humanoid root part. try swapping to a local script (must be in a place where localscripts can be though)

You can also just set the serverscripts run context to local, that should work aswell (you might wanna increase your jump pad power to 100 instead of 50)

1 Like

A server script cannot apply velocity to a player’s character because of how network ownership works. You can either fire a remote to the client so they’ll handle the velocity, or make the script client-sided, though the effects will only be seen locally.

cool. i decided to make a remote event and fire to the player touching the pad, and it works.
now i just realized that the swords in my game that move characters will work on dummies but not players lol.

this be would not be quite convenient since this script is best for a single jump pad. i of course am gonna need a bunch of jump pads everywhere lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.