this is the code I previously came up with, and, besides the fact that it just gives you a boost every time you press b on the gamepad, it wouldn't work anyways because the boost it was giving me was always in the wrong direction, unless I faced the direction it was giving me a boost in. its hard to describe but here is the code I tried.
local plyr = game.Players.LocalPlayer
while true do db=false j=0 repeat wait(.1) until plyr.Character local InputKey = "ButtonB" deb=false B1=false B=0
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:connect(function(UserInput) if UserInput.UserInputType == Enum.UserInputType.Gamepad1 then
if UserInput.KeyCode == Enum.KeyCode[InputKey] and deb==false and B1 == false then
B=1 for i = 2,1,-1 do print (B) deb=true B1 = true if UserInput.UserInputType == Enum.UserInputType.Gamepad1 then if UserInput.KeyCode == Enum.KeyCode[InputKey] and deb==true and B1 == true and i>0 and B==1 then plyr.Character.Torso.Velocity=Vector3.new(50,0,0) script.S2:Play() local character = plyr.Character local animation = character.Humanoid:LoadAnimation(script.Slide) animation:Play() wait(.2) B=2 print(B) deb=false wait(.5) animation:Stop()
else
B=0
B1=false
deb=false
end
end
end
end
end
end)
end

1 comment
Please fix the code blocks.