Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is LocalScript only working certain Axises?

Asked by 6 years ago

Hi I tried to do this script. I tried very hard over and over and I still can't get it to work. The script has no errors , but you only move to the right if you are in a certain axis, if you are in another axis will just make me go backwards. I want it so no matter what axis you are in you will always go to the right here's what I did:

  • This script basically makes a player dash/move to the right

Sorry, I am really bad with CFrame and Vector3

Sorry if I worded this bad, ask me for explaining better if you didn't understand what I said.

local uis = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local hum = plr.Character.Humanoid
local cac = plr.Character




uis.InputBegan:connect(function(i)
    if i.KeyCode == Enum.KeyCode.F then
        hum:ChangeState(Enum.HumanoidStateType.Jumping)
        cac.HumanoidRootPart.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.rightVector*50

    end
end)

Thanks, activatesenju

Answer this question