✓ Accepted answer
You would want to modify the velocity like this:
player.Velocity = player.Velocity + Vector3.new(0,10,0)
This way you are saying that you want the velocity to be what it currently is, but then you add a Vector3 value. The computer was confused before because it thought you were just adding numbers.
Also the method you used of modifying a part's velocity will work if it's a part, but I don't think that method will work with a player. What I've done is used "BodyVelocity" which is a body mover. First I create it inside of the humanoid root part and then I modify the Velocity of the Body Velocity.
Here is the full script:
local Player = game:GetService("Players").LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local root = char:WaitForChild("HumanoidRootPart")
local mouse = Player:GetMouse()
local bodyVelocity = Instance.new("BodyVelocity", root)
bodyVelocity.Velocity = Vector3.new(0,0,0)
mouse.KeyDown:Connect(function(key)
local Key = key.lower("e")
if key == ("e") then
bodyVelocity.Velocity = bodyVelocity.Velocity + Vector3.new(0, 10, 0)
end
end)
mouse.KeyDown:Connect(function(key)
local Key = key.lower("q")
if key == ("q") then
bodyVelocity.Velocity = bodyVelocity.Velocity + Vector3.new(0, -10, 0)
end
end)