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

How to make player evade left or right wherever they are standing?

Asked by
Jirozu 71
7 years ago

I have gotten most of the script down, but i never learned on how i can make the character move left or right wherever there are standing, any help (if you dont understand what im trying to get at ill give more detail.)

--{{Core Evade System}}--
--If Player Evades Right:
game.ReplicatedStorage.RemoteEvents.EvadeRightEvent.OnServerEvent:connect(function(Player)
    if CanEvade == true then
        CanEvade = false
        local bv = Instance.new("BodyVelocity", Character.LowerTorso)
        bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
        bv.velocity = Vector3.new(-45, 0, 0)
        wait(0.3)
        bv:Remove()
    CanEvade = true
    end
end)

--If Player Evades Left:
game.ReplicatedStorage.RemoteEvents.EvadeLeftEvent.OnServerEvent:connect(function(Player)
    if CanEvade == true then
        CanEvade = false
        local bv = Instance.new("BodyVelocity", Character.LowerTorso)
        bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
        bv.velocity = Vector3.new(45, 0, 0)
        wait(0.3)
        bv:Remove()
    CanEvade = true
    end
end)

Have a good day!

0
. Jirozu 71 — 7y

Answer this question