Hello, I've created a new skript, but there are lots of sounds and the skript reloads within 2 minutes. I'm using SkQuerry, skript 2.2 benskus's edit 27-dev and Skellett.
The problem is that I'm using this sentence, and it doesn't allow me to set a variable to a number, and then set this variable in the item quantity (number 9 in this small code)
How can I make the skript smaller, using loops and those things? Couse I can't because of the the sentence error
code:
The problem is that I'm using this sentence, and it doesn't allow me to set a variable to a number, and then set this variable in the item quantity (number 9 in this small code)
code_language.skript:
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
code:
code_language.skript:
command /pistol:
trigger:
set {pistol.ammo.%player%} to 10
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
on rightclick:
name of player's tool contains "&6Pistol &8»":
cancel event
if {pistol.ammo.%player%} is 0:
send "&cOUT OF AMMO! &eRecharge!"
play sound "BLAZE_HIT" to player with volume 1 and pitch 1
else:
if {pistol.recharging.%player%} is true:
send "&cWait, your pistol is recharging"
else:
remove 1 from {pistol.ammo.%player%}
shoot an arrow at speed 8
if {pistol.ammo.%player%} is 9:
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 8:
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 7:
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 6:
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &6%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 5:
set slot 1 of player to 5 iron hoe named "&6Pistol &8» &6%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 4:
set slot 1 of player to 4 iron hoe named "&6Pistol &8» &c%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 3:
set slot 1 of player to 3 iron hoe named "&6Pistol &8» &c%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 2:
set slot 1 of player to 2 iron hoe named "&6Pistol &8» &4%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 1:
set slot 1 of player to 1 iron hoe named "&6Pistol &8» &4%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} is 0:
set slot 1 of player to 1 iron hoe named "&6Pistol &8» &4%{pistol.ammo.%player%}%"
play sound "BLAZE_HIT" to player with volume 1 and pitch 1
on leftclick:
name of player's tool contains "&6Pistol &8»":
cancel event
if {pistol.ammo.%player%} is more than 10:
set {pistol.ammo.%player%} to 10
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
if {pistol.ammo.%player%} = 10:
send "&aYour pistol is full charged! Kill them!"
if {pistol.ammo.%player%} is 9:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 8:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 7:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 6:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 5:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 4:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 5 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 3:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 4 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 5 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 2:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 3 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 4 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 5 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 1:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 2 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 3 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 4 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 5 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false
if {pistol.ammo.%player%} is 0:
set {pistol.recharging.%player%} to true
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 1 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 2 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 3 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 4 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 5 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 6 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 7 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 8 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 9 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
wait 0.5 seconds
add 1 to {pistol.ammo.%player%}
set slot 1 of player to 10 iron hoe named "&6Pistol &8» &a%{pistol.ammo.%player%}%"
play sound "ITEM_PICKUP" to player with volume 1 and pitch 1
set {pistol.recharging.%player%} to false