Charging System Not working

Pizza

Member
Been trying to get this to work, what am i doing wrong
Code:
local kicharge 

addHook("ThinkFrame", function(player)
	for player in players.iterate do
		if player.mo.skin ~= "songoku" then
			continue
		end
		
		if not (player.cmd.buttons & BT_CUSTOM1) and kimeter == 118
		        kicharge = false
			kitimer = 0
                elseif kimeter < 118
		        kicharge = true
			kitimer = TICRATE*2
       end
   end
end)
 
A lot of this syntax is hard for me to understand, but many errors are present, first of all flag tables like cmd.buttons, are a series of bits, if you want to check for the buttons being pressed you should use this;
Code:
if player.cmd.buttons == player.cmd.buttons | BT_JUMP then
I don't think ill ever wrap my head around putting functions inside the playerthink hook either, which is theoretically correct, but uses the wrong hook string, and if i've missed anything, you can check the wiki for everything, trust me.

---------- Post added at 10:14 PM ---------- Previous post was at 10:12 PM ----------

Oh yea kicharge is outside the playerthink hook and is a local, so it's effective accross all players, and the first instruction with ktimer is to check it for something that isn't nil
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top