I’m trying to get a perfect roll if the player gets intercepted by a wall I just simply want him to either get pushed back or just stop.
Currently whenever the player rolls or uses any sort of ability that sends them forward and they hit something it causes the player to glitch out then fall back and just lie there.
I tried using my anti trip command I use on the bosses in this game (ran in a do-while loop):
_G.antiTrip=function(char)
if char.Humanoid:GetState()==Enum.HumanoidStateType.FallingDown then
char.Humanoid:ChangeState(2)
end
if char.Humanoid:GetState()==Enum.HumanoidStateType.Ragdoll then
char.Humanoid:ChangeState(2)
end
end
This sadly didn’t give me what I wanted (It was very awkward).
This happens many times, here is a gif when I hit intercept an invisible wall in the lobby.
Current Roll Code:
remotes.Roll.OnServerInvoke=function(plr, mouseVector, mouseTarget)
local fodler = _G.getFolder(plr.Name)
if fodler:FindFirstChild("Loading")~=nil then
repeat wait() until fodler:FindFirstChild("Loading")==nil
end
if game.ServerStorage.PlrModules:FindFirstChild(plr.Name)~=nil and game.ServerStorage.PlrModules:FindFirstChild(plr.Name).Stats.canRoll.Value==true then
spawn(function()
game.ServerStorage.PlrModules:FindFirstChild(plr.Name).Stats.canRoll.Value = false
wait(8)
game.ServerStorage.PlrModules:FindFirstChild(plr.Name).Stats.canRoll.Value = true
end)
else
return
end
local module = require(game.ServerStorage.PlrModules:FindFirstChild(plr.Name).AttackHandler)
local char = plr.Character
local rato = char.Humanoid.Health/char.Humanoid.MaxHealth
local power = game.ServerStorage.PlrModules:FindFirstChild(plr.Name).Stats.canRoll.rollPower.Value
char.Humanoid.AutoRotate=false
module.Cooldowns.useable=false
game.ServerStorage.PlrModules:FindFirstChild(plr.Name).Stats.canRoll.isRolling.Value = true
--game.ReplicatedStorage.ClientServer.StopAnimations:FireClient(plr)
game.ReplicatedStorage.ClientServer.PlayAnimation:InvokeClient(plr, game.ServerStorage.AnimSets.Universal.Dive.Name)
plr.Character.Torso.Dive:Play()
local vel=Instance.new("BodyVelocity")
if char.HumanoidRootPart.Velocity.magnitude>1 then
vel.Velocity=char.HumanoidRootPart.Velocity.unit*100
else
vel.Velocity=char.HumanoidRootPart.CFrame.lookVector*100
end
char.HumanoidRootPart.CFrame=CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position+vel.Velocity)
vel.MaxForce=Vector3.new(999999, 0, 999999)
vel.Parent=char.HumanoidRootPart
_G.Buff(char, char, "Defence", 1, 0.4)
wait(.25)
vel.Velocity=char.HumanoidRootPart.CFrame.lookVector*(30+(power/2)+(rato*(power/2+12.5)))
wait(.2)
vel.Velocity=char.HumanoidRootPart.CFrame.lookVector*(10+(power/2)+(rato*(power/2+7.5)))
wait(.2)
module.Cooldowns.useable=true
game.ServerStorage.PlrModules:FindFirstChild(plr.Name).Stats.canRoll.isRolling.Value = false
vel:Destroy()
char.Humanoid.AutoRotate=true
wait(.05)
end
(Current a Remote Function, Will be converted to remote event later on)