Author Topic: How do i set it so i only hold space while jumping  (Read 1240 times)

0 Members and 1 Guest are viewing this topic.

Offline GrizzlyHD

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
How do i set it so i only hold space while jumping
« on: December 22, 2017, 01:02:27 PM »
Hello! I'm in need of help with this custom ulx command. Can someone tell me how to make it so i hold down space it auto hops for me?

if CLIENT then
hook.Add("CreateMove", "BHop", function(ucmd)
local ply = LocalPlayer()
if LocalPlayer():GetNWInt("bhop") == 1 and IsValid(ply) and bit.band(ucmd:GetButtons(), IN_JUMP) > 0 then
if ply:OnGround() then
ucmd:SetButtons( bit.bor(ucmd:GetButtons(), IN_JUMP) )
end
end
end)
end

function ulx.bhop(calling_ply, target_ply,bool)

target_ply:SetNWInt("bhop",bool)
ulx.fancyLogAdmin( calling_ply, "#A set bhop mode for #T to #s", target_ply,bool)
end
local bhop = ulx.command("Extended", "ulx bhop", ulx.bhop, "!bhop",true)
bhop:addParam{ type=ULib.cmds.PlayerArg }
bhop:addParam{ type=ULib.cmds.NumArg, hint="1 to enable", min=0,max=1 }
bhop:defaultAccess( ULib.ACCESS_ADMIN )
bhop:help( "set bhop for a player." )

if SERVER then
util.AddNetworkString( "scale" )

end


this is what it looks like so far