Lots of issues...

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

quick007

New Member
Jul 9, 2020
7
0
1
29
Deleted Post (idk how to actually delete)
 

Attachments

  • upload_2020-7-9_10-42-44.png
    upload_2020-7-9_10-42-44.png
    44.4 KB · Views: 376
Last edited:
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.
Regarding the first two problems, you cannot use quotes when you check a number argument. And that sentence is not adequate for what you are looking for. Try this:
code_language.skript:
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 set:
            if arg 1 is 1 or 2 or 3:
                if arg 2 is not set:
                    give player 64 gold ingots
                else:
                    give player %arg 2% gold ingots
            else:
                send "&cPlease specify a number between 1 and 3"
                stop
And could you explain to me what you thought this code was doing?
code_language.skript:
show mob spawner flames when arrow is shot
 
Status
Not open for further replies.