Jump to content

I want a skript where if you break a glowstone it gives you coins (Vault Plugin Balance) like 5 coins.


MoreDong

Recommended Posts

3 hours ago, Cheetah11 said:

on break:
    if event-block is glowstone:
        make console execute command "/eco give %player% 5"

 

 

somthing like this i think will work

Do you know how to make glowstone randomly spawn inside of a sellected idea?

Link to comment
Share on other sites

variables:
	{RandomX} = 0
	{RandomZ} = 0
	{RandomY} = 0
	
every 120 seconds:
	loop 10 times:
		set {RandomX} to random integer between 10 and 10
		set {RandomZ} to random integer between 10 and 10
		set {RandomY} to random integer between 10 and 10
		execute console command "/setblock %{RandomX}% %{RandomY}% %{RandomZ}% glow_stone"

havnt tested this yet but it should work

Link to comment
Share on other sites

On 8/1/2022 at 8:44 PM, Fletchermed said:
variables:
	{RandomX} = 0
	{RandomZ} = 0
	{RandomY} = 0
	
every 120 seconds:
	loop 10 times:
		set {RandomX} to random integer between 10 and 10
		set {RandomZ} to random integer between 10 and 10
		set {RandomY} to random integer between 10 and 10
		execute console command "/setblock %{RandomX}% %{RandomY}% %{RandomZ}% glow_stone"

havnt tested this yet but it should work

is there any way i can limit how much glowstone can spawn?

Link to comment
Share on other sites

command /glowstonewand:
    trigger:
        if player has permission "skript.glowwand":
            give player iron axe named "&6&lGlowstone Wand" with hidden attribute flag
            send "&aGave you a glowstone wand!"
        else:
            send "&cNo Permission"

on left click:
    if name of player's held item is "&6&lGlowstone Wand":
        if player has permission "skript.glowwand":
            cancel event
            set {glowstonepos1::%player%} to location of event-block
            send "&aPos1 set to %{glowstonepos1::%player%}%"

on right click:
    if name of player's held item is "&6&lGlowstone Wand":
        if player has permission "skript.glowwand":
            cancel event
            set {glowstonepos2::%player%} to location of event-block
            send "&aPos2 set to %{glowstonepos2::%player%}%"

command /glowstoneset [<text>]:
    trigger:
        if player has permission "skript.glowset":
            if {glowstonepos1::%player%} is set:
                if {glowstonepos2::%player%} is set:
                    if arg 1 is set:
                        if {glowstone::spawns::*} doesn't contain arg 1:
                            add arg 1 to {glowstone::spawns::*}
                            loop blocks within {glowstonepos1::%player%} and {glowstonepos2::%player%}:
                                add loop-block to {glowstone::%arg 1%::*}
                            set {glowstone::%arg 1%::amount} to 10
                            send "&aGlowstone spawn created called &c&l%arg 1%"
                        else:
                            send "&aThat spawn already exists"
                    else:
                        send "&aSpecify a name for the glowstone spawn"
                else:
                    send "&aPos2 isn't set"
            else:
                send "&aPos1 isn't set"
        else:
            send "&cNo Permission"

command /glowstoneamount [<text>] [<integer>]:
    trigger:
        if player has permission "skript.glowamount":
            if arg 1 is set:
                if {glowstone::spawns::*} contains arg 1:
                    if arg 2 is set:
                        set {glowstone::%arg 1%::amount} to arg 2
                        send "&aGlowstone spawn &c&l%arg 1% &anow randomly spawns &c&l%arg 2% &aglowstone"
                    else:
                        send "&aSpecify an amount of glowstone to spawn"
                else:
                    send "&aThat glowstone spawn doesn't exist"
            else:
                send "&aSpecify a glowstone spawn"
        else:
            send "&cNo Permission"

command /glowstonedelete [<text>]:
    trigger:
        if player has permission "skript.glowdelete":
            if arg 1 is set:
                if {glowstone::spawns::*} contains arg 1:
                    remove arg 1 from {glowstone::spawns::*}
                    delete {glowstone::%arg 1%::*}
                    delete {glowstone::%arg 1%::amount}
                    send "&aRemove the spawn &c&l%arg 1%"
                else:
                    send "&aThat spawn doesn't exist"
            else:
                send "&aSpecify a spawn to delete"
        else:
            send "&cNo Permission"

every 2 minutes:
    loop {glowstone::spawns::*}:
        loop {glowstone::%loop-value%::amount} times:
            set {_block} to random element out of {glowstone::%loop-value-1%::*}
            set block at {_block} to glowstone

on break:
    if event-block is glowstone:
        execute console command "/eco give %player% 5"

Ok so I just made most things a command. Let me explain. Do /glowstonewand to get given the wand to make your selection. Then use the command /glowstoneset {name} to create the glowstone spawn with a name. It is like regions. By default the amount of glowstone to spawn is 10 but you can change it with /glowstoneamount {name} {integer}. Finally every 2 minutes it will randomly spawn the selected amount of glowstone in the glowstone spawn area. You can make as many glowstone spawns as you want and you can set each of them to have a different amount of glowstone blocks spawn in them. Also if you ever want to delete a spawn just do /glowstonedelete {name}. Ask if you have an issues or something you want me to add.

Edited by ApexSplat

Discord: Dead#6905

Love anime!


Anime Gifs

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...