I've started Skript today, and have been working on a skript which gives you a block that you must shift on in order to continue (in a little game I am making).
I'm not sure how to add the code in a special format (and if someone could help me with that, so I can edit this post, thatd be great!) but here is what I have so far.
on load:
delete {blocks::*}
add "grass block" to {blocks::*}
add "sand block" to {blocks::*}
command /blockshuffle:
trigger:
set {block} to a random object out of {blocks::*}
send "&cYour new randomized block is &a%{block}%!"
on sneak toggle:
if player is not sneaking:
loop all players:
if block under player is {block}:
broadcast "Test"
It's far from finished, but the problem I'm having is that when it checks for if block under player is {block}:, the block that is defined (either sand block or grass block) does not work when I shift on it.
It gives me "&cYour new randomized block is &asand block!" for example
I go to try and shift on the sand block, and it does not work.
If I replace if block under player is {block}: with "sand block" or "grass block" it works (aka if block under player is sand block) but not if I am defining the variable, randomizing it, and then using that variable to shift on.
I'm not sure what I'm doing wrong, and again, I'm not too confident on Skript since I have just started today.
Thank you.
I'm not sure how to add the code in a special format (and if someone could help me with that, so I can edit this post, thatd be great!) but here is what I have so far.
on load:
delete {blocks::*}
add "grass block" to {blocks::*}
add "sand block" to {blocks::*}
command /blockshuffle:
trigger:
set {block} to a random object out of {blocks::*}
send "&cYour new randomized block is &a%{block}%!"
on sneak toggle:
if player is not sneaking:
loop all players:
if block under player is {block}:
broadcast "Test"
It's far from finished, but the problem I'm having is that when it checks for if block under player is {block}:, the block that is defined (either sand block or grass block) does not work when I shift on it.
It gives me "&cYour new randomized block is &asand block!" for example
I go to try and shift on the sand block, and it does not work.
If I replace if block under player is {block}: with "sand block" or "grass block" it works (aka if block under player is sand block) but not if I am defining the variable, randomizing it, and then using that variable to shift on.
I'm not sure what I'm doing wrong, and again, I'm not too confident on Skript since I have just started today.
Thank you.