Files
twist.sk
Code
1 481
twist.sk
options:
prefix: <##8A2BE2>👻 &7|
max-souls: 5
min-souls-for-ability: 1
soul-name: <##8A2BE2>👻 <##9B3EF5>&lS<##AC51FF>&lO<##BD64FF>&lU<##CE77FF>&lL<##DF8AFF>&lS <##B563FF>👻
reroller-name: <##F13A3A>🎲 <##F44444>R<##F54949>E<##F64D4D>R<##F75252>O<##F95757>L<##FA5C5C>L<##F95656>E<##F75151>R <##F44545>🎲
on load:
set {aspire::souls} to a player head named "&fSoul" with lore "&7Right-click to collect this soul."
set {aspire::reroller} to a nether star named "{@reroller-name}" with lore "<##F13A3A>Use this to reroll your current axe if you" and "<##F13A3A>want a different one. Every axe has fair odds. Good luck!" and "&7" and "&7Right-click to use" and "" and "&cWarning: Do not spam-click or stack the reroller."
function giveAxeToPlayer(p: player, type: text):
loop all items in {_p}'s inventory:
if name of loop-item contains "Axe":
remove loop-item from {_p}'s inventory
if {_type} is "Frost":
give a netherite axe named "<##A3BDFF>Frost Axe" with lore "&bRight-click to use your ability." and "&7Requires at least 1 soul." to {_p}
else if {_type} is "Berserker":
give a netherite axe named "<##A30C13>Berserker Axe" with lore "<##A30C13>Right-click to use your ability." and "&7Requires at least 1 soul." to {_p}
else if {_type} is "Thunder":
give a netherite axe named "&2Thunder Axe" with lore "&2Right-click to use your ability." and "&7Requires at least 1 soul." to {_p}
else if {_type} is "Inferno":
give a netherite axe named "<##FAC000>Inferno Axe" with lore "<##FAC000>Right-click to use your ability." and "&7Requires at least 1 soul." to {_p}
else if {_type} is "Vitality":
give a netherite axe named "<##EC51AF>Vitality Axe" with lore "<##EC51AF>Right-click to use your ability." and "&7Requires at least 1 soul." to {_p}
function rollAxe(p: player):
set {_number} to a random integer between 1 and 5
if {_number} is 1:
set {heart.%{p}'s uuid%} to "Frost"
send title "&0&l?" with subtitle "&fYou rolled the &7&k[][][] &faxe!" to {_p}
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to {_p}
wait 2 ticks
send title "&b&l❄" with subtitle "&fYou rolled the <##A3BDFF>&lFROST &fAxe!" to {_p} for 5 seconds
play sound "entity.generic.explode" with volume 1 to {_p}
giveAxeToPlayer({_p}, "Frost")
else if {_number} is 2:
set {heart.%{p}'s uuid%} to "Inferno"
send title "&0&l?" with subtitle "&fYou rolled the &7&k[][][] &faxe!" to {_p}
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to {_p}
wait 2 ticks
send title "<##FAC000>&l🔥" with subtitle "&fYou rolled the <##FAC000>&lINFERNO &fAxe!" to {_p} for 5 seconds
play sound "entity.generic.explode" with volume 1 to {_p}
giveAxeToPlayer({_p}, "Inferno")
else if {_number} is 3:
set {heart.%{p}'s uuid%} to "Berserker"
send title "&0&l?" with subtitle "&fYou rolled the &7&k[][][] &faxe!" to {_p}
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to {_p}
wait 2 ticks
send title "<##A30C13>&l⚔" with subtitle "&fYou rolled the <##A30C13>&lBERSERKER &fAxe!" to {_p} for 5 seconds
play sound "entity.generic.explode" with volume 1 to {_p}
giveAxeToPlayer({_p}, "Berserker")
else if {_number} is 4:
set {heart.%{p}'s uuid%} to "Thunder"
send title "&0&l?" with subtitle "&fYou rolled the &7&k[][][] &faxe!" to {_p}
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to {_p}
wait 2 ticks
send title "&2&l⚡" with subtitle "&fYou rolled the &2&lTHUNDER &fAxe!" to {_p} for 5 seconds
play sound "entity.generic.explode" with volume 1 to {_p}
giveAxeToPlayer({_p}, "Thunder")
else if {_number} is 5:
set {heart.%{p}'s uuid%} to "Vitality"
send title "&0&l?" with subtitle "&fYou rolled the &7&k[][][] &faxe!" to {_p}
loop 30 times:
play sound "BLOCK.NOTE_BLOCK.PLING" to {_p}
wait 2 ticks
send title "<##EC51AF>&l❤" with subtitle "&fYou rolled the <##EC51AF>&lVITALITY &fAxe!" to {_p} for 5 seconds
play sound "entity.generic.explode" with volume 1 to {_p}
giveAxeToPlayer({_p}, "Vitality")
command /setsouls <offline player> <integer>:
permission: axesouls.setsouls
trigger:
set {souls.%arg-1's uuid%} to arg-2
send "&dSet %arg-1%'s souls to %arg-2%." to player
if arg-1 is online:
send "&dAn admin set your souls to %arg-2%." to arg-1
command /setaxe <offline player> <text>:
permission: axesouls.setaxe
trigger:
if {customaxe.%arg-1's uuid%} is set:
send "&c&l! &c%arg-1% already has a custom axe. Do /setcustomaxe %arg-1% None." to player
stop
set {_target} to arg-1
set {_type} to arg-2
if {_type} is "Frost":
set {heart.%{_target}'s uuid%} to "Frost"
if {_target} is online:
set {_p} to {_target}
send "&dAxeSMP &7| &dAn admin changed your axe to <##A3BDFF>Frost Axe&d." to {_p}
send "&dAxeSMP &7| <##A3BDFF>Set %{_target}%'s axe to Frost." to player
set {_p}'s max health to 10
giveAxeToPlayer({_p}, "Frost")
else:
send "&dAxeSMP &7| <##A3BDFF>Set %{_target}%'s axe to Frost &7(offline)<##A3BDFF>." to player
else if {_type} is "Berserker":
set {heart.%{_target}'s uuid%} to "Berserker"
if {_target} is online:
set {_p} to {_target}
set {_p}'s max health to 10
send "&dAxeSMP &7| &dAn admin changed your axe to &4Berserker Axe&d." to {_p}
send "&dAxeSMP &7| &4Set %{_target}%'s axe to Berserker." to player
giveAxeToPlayer({_p}, "Berserker")
else:
send "&dAxeSMP &7| &4Set %{_target}%'s axe to Berserker &7(offline)&4." to player
else if {_type} is "Thunder":
set {heart.%{_target}'s uuid%} to "Thunder"
if {_target} is online:
set {_p} to {_target}
set {_p}'s max health to 10
send "&dAxeSMP &7| &dAn admin changed your axe to &2Thunder Axe&d." to {_p}
send "&dAxeSMP &7| &2Set %{_target}%'s axe to Thunder." to player
giveAxeToPlayer({_p}, "Thunder")
else:
send "&dAxeSMP &7| &2Set %{_target}%'s axe to Thunder &7(offline)&2." to player
else if {_type} is "Inferno":
set {heart.%{_target}'s uuid%} to "Inferno"
if {_target} is online:
set {_p} to {_target}
set {_p}'s max health to 10
send "&dAxeSMP &7| &dAn admin changed your axe to &6Inferno Axe&d." to {_p}
send "&dAxeSMP &7| &6Set %{_target}%'s axe to Inferno." to player
giveAxeToPlayer({_p}, "Inferno")
else:
send "&dAxeSMP &7| &6Set %{_target}%'s axe to Inferno &7(offline)&6." to player
else if {_type} is "Vitality":
set {heart.%{_target}'s uuid%} to "Vitality"
if {_target} is online:
set {_p} to {_target}
set {_p}'s max health to 10
send "&dAxeSMP &7| &dAn admin changed your axe to &dVitality Axe&d." to {_p}
send "&dAxeSMP &7| &dSet %{_target}%'s axe to Vitality." to player
giveAxeToPlayer({_p}, "Vitality")
else:
send "&dAxeSMP &7| &dSet %{_target}%'s axe to Vitality &7(offline)&d." to player
else:
send "&cInvalid axe type. Use: Frost, Berserker, Thunder, Inferno, or Vitality." to player
on join:
if {souls.%player's uuid%} is not set:
set {souls.%player's uuid%} to 0
if {heart.%player's uuid%} is not set:
send title "" with subtitle "&fRolling your random axe..." to player
wait 2 seconds
rollAxe(player)
on right click:
if player's tool is a player head:
if name of player's tool is "&fSoul":
cancel event
if {souls.%player's uuid%} < {@max-souls}:
remove 1 of player's tool from player's inventory
add 1 to {souls.%player's uuid%}
send "{@prefix} <##8A2BE2>Soul collected. &7(%{souls.%player's uuid%}% / {@max-souls})" to player
play sound "entity.experience_orb.pickup" with volume 1 to player
else:
send "&c👻 You already have the maximum amount of souls!" to player
play sound "entity.villager.no" to player
stop
on right click:
if player's tool is a nether star:
if name of player's tool contains "REROLLER":
cancel event
remove 1 of player's tool from player's inventory
rollAxe(player)
stop
on right click:
if name of player's tool contains "Axe":
cancel event
if {locked.%player's uuid%} is set:
send "<##A30C13>⚔ <#AE1616>Your<#B71C1C> abi<#BF2121>lity<#C82727> has<#D12D2D> bee<#D93232>n lo<#E23838>cked<#D83131> by <#CD2A2A>a be<#C32424>rser<#B81D1D>ker u<#AE1616>ser. &7(%{locked.%player's uuid%}%s)" to player
stop
if {souls.%player's uuid%} is not set:
set {souls.%player's uuid%} to 0
if {souls.%player's uuid%} < {@min-souls-for-ability}:
send "&cYou need at least 1 soul to use this ability!" to player
play sound "entity.villager.no" to player
stop
set {_heart} to {heart.%player's uuid%}
if {_heart} is not set:
send "&c&l! &cYou do not have an axe type assigned!" to player
stop
if {_heart} is "Frost":
if target entity is a player:
if {frozen.%target entity's uuid%} is not set:
remove 1 from {souls.%player's uuid%}
set {_duration} to 5
set {noeat.%target entity's uuid%} to {_duration}
play sound "block.beacon.activate" at volume 0.7 to player
send "&f &f &f &f &b&l❄ FREEZE ❄" to player
send "" to player
send "&bFreeze your target for 5 seconds." to player
send "&bThey also cannot consume anything for %{_duration}% seconds." to player