#skript of custom blade
1 messages · Page 1 of 1 (latest)
if name of player's tool = "&fМеч Альфа Волка":
if player's level >= 60:
if player is op:
set {player's uuid%.sweepAttackGun.cooldown} to 0 seconds
else:
set {player's uuid%.sweepAttackGun.cooldown} to 20 seconds
if difference between now and {player's uuid%.sweepAttackGun.lastUsed} is greater than or equal to {player's uuid%.sweepAttackGun.cooldown}:
set {player's uuid%.sweepAttackGun.lastUsed} to now
shoot white particles from location of player to location of player + 5 blocks in direction of player's facing direction
deal 15 damage to all entities within 1 block of location of player + 5 blocks in direction of player's facing direction
else:
send "Вы должны подождать %{difference between now and {player's uuid%.sweepAttackGun.lastUsed}} секунд перед использованием этого предмета снова!" to player
else:
send "У вас недостаточно уровня, чтобы использовать этот предмет!" to player
not usable```
what about it doesn't work?
like specifically is it not checking the right item name, not setting the cooldown...?
its a bit difficult to understand the issue
wdym by 'type true' and 'type errors'?
dropping it into a parser, i can see there are a few syntax issues that need to be fixed
you have to wrap player's uuid in a % but you are forgetting one percentage sign on the left side of each time the variable is called
oh
wait 1 min
if name of player's tool = "&fМеч Альфа Волка":
if player's level >= 60:
if player is op:
set {%player's uuid%.sweepAttackGun.cooldown} to 0 seconds
else:
set {%player's uuid%.sweepAttackGun.cooldown} to 20 seconds
if difference between now and {player's uuid%.sweepAttackGun.lastUsed} is greater than or equal to {%player's uuid%.sweepAttackGun.cooldown}:
set {%player's uuid%.sweepAttackGun.lastUsed} to now
shoot white particles from location of player to location of player + 5 blocks in direction of player's facing direction
deal 15 damage to all entities within 1 block of location of player + 5 blocks in direction of player's facing direction
else:
send "Вы должны подождать %{difference between now and {%player's uuid%.sweepAttackGun.lastUsed}} секунд перед использованием этого предмета снова!" to player
else:
send "У вас недостаточно уровня, чтобы использовать этот предмет!" to player
not usable```
Did I understand correctly?
yes, you did it properly
reload to see if there are any issues (pasted it into a parser and no errors for me)
ok ty)
not working
-_-
if name of player's tool = "Меч Альфа Волка":
if player's level >= 60:
if player is op:
set {%player's uuid%.sweepAttackGun.cooldown} to 0 seconds
else:
set {%player's uuid%.sweepAttackGun.cooldown} to 20 seconds
if difference between now and {%player's uuid%.sweepAttackGun.lastUsed} is greater than or equal to {%player's uuid%.sweepAttackGun.cooldown}:
set {%player's uuid%.sweepAttackGun.lastUsed} to now
shoot white particles from location of player to location of player + 5 blocks in direction of player's facing direction
deal 15 damage to all entities within 1 block of location of player + 5 blocks in direction of player's facing direction
else:
send "Вы должны подождать %{difference between now and {%player's uuid%.sweepAttackGun.lastUsed}} секунд перед использованием этого предмета снова!" to player
else:
send "У вас недостаточно уровня, чтобы использовать этот предмет!" to player```
we need some more information
what are the errors? what doesn't work properly? 
that means there are no errors
so what about it doesn't work?
I has 60 lvl and this dnt work
then try to debug it
use broadcast statements to see what conditions aren't passing
make sure your tool is properly named (no coloring allowed since you don't check the unformatted name)
How
bc states
like put a broadcast "test" after checking the player's tool condition and if they are op
this is your job now to figure out the rest of the issues (this is a logic issue, not a syntax issue anymore)
also, it's recommended to really use list variables. And, you should also put the player as the index. Ie, {cooldown::sweepAttack::%player's UUID%}
^^ very good resource, highly recommend you read it
@unkempt echo
look at the warning message
you didnt indent it properly (all sections need to be indented)
read the error
you must place it after an if statement
like:
do stuff
else:
...
Probably the indentation for that if/else pair is messed up, or you have an error for the if statement too. fix that, then it should expect an else
if player's tool's name contains "fff":
broadcast "test"
if player's level >= 60:
if player is op:
set {%player's uuid%.sweepAttackGun.cooldown} to 0 seconds
else:
set {%player's uuid%.sweepAttackGun.cooldown} to 20 seconds
if difference between now and {%player's uuid%.sweepAttackGun.lastUsed} is greater than or equal to {%player's uuid%.sweepAttackGun.cooldown}:
set {%player's uuid%.sweepAttackGun.lastUsed} to now
shoot white particles from location of player to location of player + 5 blocks in direction of player's facing direction
deal 15 damage to all entities within 1 block of location of player + 5 blocks in direction of player's facing direction
else:
send "Вы должны подождать %{difference between now and {%player's uuid%.sweepAttackGun.lastUsed}} секунд перед использованием этого предмета снова!" to player
else:
send "У вас недостаточно уровня, чтобы использовать этот предмет!" to player```
not working -_-
errors not has
okay, then whats the issue?
custom skill dont useing
then one of your conditions fails
no one has
can you try debugging it with a broadcast to see where the code is breaking?
bc not typing
if player's tool's name contains "fff":
broadcast "test"
if player's level >= 60:
if player is op:
set {%player's uuid%.sweepAttackGun.cooldown} to 0 seconds
else:
set {%player's uuid%.sweepAttackGun.cooldown} to 20 seconds
if difference between now and {%player's uuid%.sweepAttackGun.lastUsed} is greater than or equal to {%player's uuid%.sweepAttackGun.cooldown}:
set {%player's uuid%.sweepAttackGun.lastUsed} to now
shoot white particles from location of player to location of player + 5 blocks in direction of player's facing direction
deal 15 damage to all entities within 1 block of location of player + 5 blocks in direction of player's facing direction
else:
send "Вы должны подождать %{difference between now and {%player's uuid%.sweepAttackGun.lastUsed}} секунд перед использованием этого предмета снова!" to player
else:
send "У вас недостаточно уровня, чтобы использовать этот предмет!" to player```
Think I can see an issue in difference between now and {%player's uuid%.sweepAttackGun.lastUsed}
now is a time__stamp__, but the variable is a time__span__
you should set the variable to now when they use it, then you can check if the time since is less than the cooldown duration
can u retype sk?
also, looking at the full line,
difference between now and {%player's uuid%.sweepAttackGun.lastUsed} is greater than or equal to {%player's uuid%.sweepAttackGun.cooldown}
Why are you comparing the variable to itself?
I do stupied
-_-
line?
I'm not gonna do it for you, but here's an example:
if time since {} < 10 seconds:
send "You must wait 10s before doing this!" to player
else:
set {} to now
#ability code here```
x8 provided an example of how to do it, you have to use what he gave you as a template and fix the issue yourself
for starters, {} needs to be the proper variable