So I am trying to making speed increase when you hold down a button, I was only able to make it increase when clicking a key again and again. This is what I have rn.
game.ReplicatedStorage.Takeoff.OnServerEvent:connect(function(client, event, data)
if event == "On" and client == player then
bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
elseif event == "Speed" and client == player then
baseSpeed = baseSpeed + 10
elseif event == "Slow" and client == player then
baseSpeed = baseSpeed - 5
elseif event == "Fly" and client == player then
bg.CFrame = data
direction = bg.CFrame.lookVector
direction = Vector3.new(direction.X, direction.Y, direction.Z).unit
bv.Velocity = direction*baseSpeed
elseif event == "Off" and client == player then
bv.maxForce = Vector3.new(0,0,0)
bg.maxTorque = Vector3.new(0,0,0)
end
end)a
