How make Bezier Curve player

hi i want some help i have script the problem it i want make player super jump with Bezier Curve i use free model script for skill so i think if we change skill to player it will be jump i noob at script

ocal function lerp(p0,p1,t)
	return p0*(1-t) + p1*t
end

local function quad(p0,p1,p2, t)
	local l1 = lerp(p0,p1,t)
	local l2 = lerp(p1,p2,t)
	local quad = lerp(l1,l2,t)
	return quad
end

local ts = game:GetService("TweenService")
local ti = TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)

game.ReplicatedStorage.fireballremote.OnServerEvent:Connect(function(player, mousehit, lv)
	local character = player.Character
	local hrp = player.Character.HumanoidRootPart
	local start = hrp.Position
	
	local finish = mousehit.Position
	
	local left = hrp.Position + Vector3.new(40,30,0)
	local right = hrp.Position + Vector3.new(-40,30,0)
	
	local middle = (finish - start) + Vector3.new(30,30,0)
	
	hrp.CFrame = CFrame.new(hrp.Position, hrp.Position + lv)
	
	local star = here problem
	star.Parent = workspace
	star.Position = start

	
	for i = 0, 100 do
		local t = i/100	
		
		local updated = quad(start,left,finish,t)	
		local u2 = quad(start,right+Vector3.new(-20,0,0),finish,t)
		local u3 = lerp(start, finish, t)
		local u4 = quad(start,middle,finish,t)
		
		star.Position = updated		

		
		task.wait(0.01)
		if i == 100 then
			wait(1/2)
			ts:Create(star, ti, {Transparency = 1}):Play()

			break
		else
			--spin
				star.CFrame = star.CFrame * CFrame.Angles(0,math.rad(37), 0)

		end
	end
end)
1 Like

1: Please, please PLEASE just use RunService.Heartbeat for a loop that runs every tick.
2: NEVER mix and match task.wait() and wait(), it looks awful and is just a terrible idea in general.
3: Save the tween as a variable so you can delete the TweenBase after and prevent a memory leak.
4: What is here problem meant to mean?? Use two dashes for comments -- like this and leave the original code there.
5: Please use sanity checks whenever you use .OnServerEvent. If you’re not bothered, just DON’T USE IT. Exploiters can easily fire the RemoteFunction with malicious values.

1 Like

thx that help me
i have one question is there way do without remote function