#right click detections

1 messages · Page 1 of 1 (latest)

timber stone
#

I'm tryna code a weapon that has a normal right click detection then run a function, that I know how to do but is it possible to code in a " if you hold right click for x seconds" then do smth else?

primal valley
#

I would do it like this (with an ender eye):

when you hold right-click a score(ex. r_hold) gets 1 added. When this is not 0 you also check every tick to see if it has the same value as in the previous tick. If yes set the score back to 0. To trigger the special attack the r_hold score has to reach a set value (5 seconds => 100 ticks)

celest sluice