You would want to modify the velocity like this:
1 | player.Velocity = player.Velocity + Vector 3. 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:
01 | local Player = game:GetService( "Players" ).LocalPlayer |
03 | local char = Player.Character or Player.CharacterAdded:Wait() |
05 | local root = char:WaitForChild( "HumanoidRootPart" ) |
09 | local mouse = Player:GetMouse() |
13 | local bodyVelocity = Instance.new( "BodyVelocity" , root) |
15 | bodyVelocity.Velocity = Vector 3. new( 0 , 0 , 0 ) |
17 | mouse.KeyDown:Connect( function (key) |
21 | local Key = key.lower( "e" ) |
27 | bodyVelocity.Velocity = bodyVelocity.Velocity + Vector 3. new( 0 , 10 , 0 ) |
39 | mouse.KeyDown:Connect( function (key) |
43 | local Key = key.lower( "q" ) |
47 | bodyVelocity.Velocity = bodyVelocity.Velocity + Vector 3. new( 0 , - 10 , 0 ) |