im trying to make a script so when you click a part it moves up and flings you up too but when i run it, nothing happens. im not getting any errors either
up = false
local function onClicked(player)
if up == false then
up = true
player.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0, 85, 0)
for i = 1, 2 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,3.28,0)
wait()
end
wait(0)
for i = 1, 8 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,-0.82,0)
wait(0)
end
wait(0.2)
up = false
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)