Skript Version (do not put latest): Minehut version
Skript Author: Myself
Minecraft Version: 1.16
Note: Ok, so I have a skript thats supposed to allow people to do /gun to get a gun, /ammo (tier) (amount) to get the ammo (only 1st tier atm). Its supposed to allow you to shoot once, then make you reload by dropping it. At the moment, it just allows people to reload once on join, then be able to continue shooting. Some errors do not even display.
Code:
command /gun:
permission: guns.test
trigger:
set {gun} to iron ingot named "&cTest Gun" with lore "&7Some text about the making of || this blah blah"
give {gun} to the player
command /ammo [<integer>] [<integer>]:
permission: guns.ammo
trigger:
if arg 1 is not set:
message "&cPlease specify a number between 1 and 3"
if arg 1 is not "1" "2" "3":
message "&cPlease specify a number between 1 and 3"
if arg 1 is "1":
if arg 2 is not set:
give player 64 gold ingots
else:
give player %arg 2% gold ingots
#Reloading
on drop:
if event-item is iron ingot:
cancel event
if {reload} is false:
if player has {t1ammo}:
message "&cReloading..."
execute console command "/playsound minecraft:block.basalt.break ambient %player%"
remove 1 gold ingot from player's inventory
wait 30 ticks
message "&2Reloaded!"
set {reload} to true
else:
message "&fPlease get tier 1 ammo by &lopening crates or locating airdrops"
else if {reload} is true:
message "&4Your gun is already loaded"
#Shooting
on rightclick:
cancel event
if {reload} is true:
player is holding iron ingot
shoot arrow from player at speed 3
show mob spawner flames when arrow is shot
execute console command "/playsound minecraft:block.basalt.break ambient %player%"
else:
cancel event
message "&cPlease reload by pressing the letter q"
on damage:
set {dheath} to health of victim
send "&cYour opponents health is at ❤%{dheath}%" to the attacker
on load:
set {t1ammo} to gold ingot
on join:
set {reload} to false
Errors (2 of them are because I don't have skdragon)
View attachment 5012
Addons using:
Skbee, Skelet, skquery,vixo
Have you tried searching the docs? No
Have you tried searching the forums? Some
What other methods have you tried to fix it? I tried to rewrite the code a little bit and cleared up a lot of errors.