#how to detect left click using entityHit?

1 messages · Page 1 of 1 (latest)

sage ether
#

i would like to set a player's scoreboard to 1 when they are left clicking, and to 0 when they aren't left clicking. how would i do this (new to scripting)

spark flicker
#

Why do you want to set the scoreboard that way, if i may ask?

#

I don't think it's possible to detect when player is hitting empty air

frail flower
sage ether
#

no no like, im basically trying to detect when the player is left clicking, like how you would with an animation controller with variable.attack_time , except with scripts. while the player is swinging, scoreboard = 1 , while the player is not swinging, scoreboard = 0

frail flower
#

so left clicking at any time?

sage ether
#

yea

frail flower
#

because you can't check for left click while punching air but you can check for left clicking on blocks and entities if that's what you want

sage ether
#

ohh ok then nvm its fine

#

ty

frail flower
#

so you don't want help anymore?

sage ether
#

well actually, i am now wondering, how would i detect when the player punches a block?

crimson patio
#

if a player punches a block then yes, you can use detect it using entityHit

frail flower