why wont this work on projectile hit: shooter is player: projectile is arrow: if {playing::%shooter%} is more than 0: block at location of projectile is Coal block: add 1 to {playing::%shooter%} set block to {randomizer} on projectile hit: shooter is player: projectile is arrow: if {playing::%shooter%} is more than 0: block at location of projectile is iron block: add 5 to {score::%shooter%} set block to {randomizer} on projectile hit: shooter is player: projectile is arrow: if {playing::%shooter%} is more than 0: block at location of projectile is gold block: add 10 to {score::%shooter%} set block at location of projectile to {randomizer} Command /score: trigger: send "&d%player%'s score is %{score::%player%}%." every second: set {1-10} to a random number between 1 and 10 every second: if {1-10} is more than 10: set {randomizer} to gold block else: if {1-10} is more than 8: set {randomizer} to iron block else: set {randomizer} to coal block command /playgame: trigger: if {playing::%player%} is less than 1: set {playing::%player%} to 1 set {score::%player%} to 0 send "&dStart" to player wait 30 seconds set {playing::%player%} to 0 send "&dOver" to player on connect: set {playing::%player%} to 0 command /reloadgame: trigger: if player is op: set {playing::%player%} to 0 command /varible: trigger: send "%{playing::%player%}%
#Minigame
1 messages · Page 1 of 1 (latest)
if only you said what wasn't working so people didn't have to go out of their way to test it
The problem is the block wont change the type and the score wont add
I forgot to metion that
did you try debugging it with broadcasts
to see if {playing::%shooter%} is more than 0 or the block at location of projectile is Coal block
That might be it thank you
The playing is working but I dont know how to check the block location but I think that might be it how would I rewrite that part to work more properly
can you please format it to make it easier to read
```code here```
also you forgot the "if" in all of those if statements
you can get away with doing it the way you are, but its unprofessional
either remove the colon and indents, or add an if
attacker is a player
# code
on death:
if attacker is a player:
#code```
projectile is arrow:
if {playing::%shooter%} is more than 0:
block at location of projectile is Coal block:
add 1 to {playing::%shooter%}
set block to {randomizer}
on projectile hit:
shooter is player:
projectile is arrow:
if {playing::%shooter%} is more than 0:
block at location of projectile is iron block:
add 5 to {score::%shooter%}
set block to {randomizer}
on projectile hit:
shooter is player:
projectile is arrow:
if {playing::%shooter%} is more than 0:
block at location of projectile is gold block:
add 10 to {score::%shooter%}
set block at location of projectile to {randomizer}
Command /score:
trigger:
send "&d%player%'s score is %{score::%player%}%."
every second:
set {1-10} to a random number between 1 and 10
every second:
if {1-10} is more than 10:
set {randomizer} to gold block
else:
if {1-10} is more than 8:
set {randomizer} to iron block
else:
set {randomizer} to coal block
command /playgame:
trigger:
if {playing::%player%} is less than 1:
set {playing::%player%} to 1
set {score::%player%} to 0
send "&dStart" to player
wait 30 seconds
set {playing::%player%} to 0
send "&dOver" to player
on connect:
set {playing::%player%} to 0
command /reloadgame:
trigger:
if player is op:
set {playing::%player%} to 0
command /varible:
trigger:
send "%{playing::%player%}%'''```
ok thats what i was missing tysm
ok, my OCD is kicking in; i just have to point these out as I see them
- use uuid variables (that way things won't be lost when a player changes their username)
- use
a(n)(shooter is player->shooter is a player,projectile is an arrow) - you can combine the 2 periodical events
- you can remove 1 indent by using
else if ..:
the score is not changing but I added the ifs what am I missing?
what score?
the score varible
also i dont see anywhere in your code that would add 1 to {_score}
it was in the coal but I used the wrong varible
ah
also its still not working but I did remove the if shooter is player and if projectile is arrow
can you be more precise than 'not working'? and send the updated code
the score wont change on projectile hit: if {playing::%shooter%} is more than 0: if block at location of projectile is Coal block: add 1 to {score::%shooter%} on projectile hit: if {playing::%shooter%} is more than 0: if block at location of projectile is iron block: add 5 to {score::%shooter%} on projectile hit: if {playing::%shooter%} is more than 0: if block at location of projectile is gold block: add 10 to {score::%shooter%} Command /score: trigger: send "&d%player%'s score is %{score::%player%}%." every second: set {1-10} to a random number between 1 and 10 every second: if {1-10} is more than 10: set {randomizer} to gold block else: if {1-10} is more than 8: set {randomizer} to iron block else: set {randomizer} to coal block command /playgame: trigger: if {playing::%player%} is less than 1: set {playing::%player%} to 1 set {score::%player%} to 0 send "&dStart" to player wait 30 seconds set {playing::%player%} to 0 send "&dOver" to player on connect: set {playing::%player%} to 0 command /reloadgame: trigger: if player is op: set {playing::%player%} to 0 command /varible: trigger: send "%{playing::%player%}%"
you can put 3 ` at the fron and the end
of what?
that symbol. then the code block will be an actual block instead of multiple lines like this:on projectile hit: if {playing::%shooter%} is more than 0: if block at location of projectile is Coal block: #I think this is the issue, the "block at event-projectile" is probably air, try "event-block" or "block at event-location" add 1 to {score::%shooter%}
cause | [ ] (an arrow on top of a block)
the majority of the arrow is above the block
thank you that was it
👍
'''d'''