Lua "ThinkFrame" hook - Checking if BT_USE and not PF_USEDOWN does not trigger at all
Checking to see if the USE (Spin) button is pressed (p.cmd.buttons & BT_USE), and not held down (p.pflags & PF_USEDOWN) fails to trigger. Within the "ThinkFrame" hook for the player.
Example Code Below:
Checking them separately gives accurate results however.
Output text in attachments:
Checking to see if the USE (Spin) button is pressed (p.cmd.buttons & BT_USE), and not held down (p.pflags & PF_USEDOWN) fails to trigger. Within the "ThinkFrame" hook for the player.
Example Code Below:
Code:
addHook("ThinkFrame", do
for p in players.iterate
if p and p.valid and not p.spectator
if (p.cmd.buttons & BT_USE) and not (p.pflags & PF_USEDOWN)
print("trigger once!!")
end
if (p.cmd.buttons & BT_USE)
print("trigger for as long the button is held!")
end
end
end
end, MT_PLAYER)
Checking them separately gives accurate results however.
Output text in attachments:
Attachments
Last edited: