so bassicly i wanted to make a skript of gens that if u sneak break them it goes to ur inventory and if the gen has the exact name it works and makes things spawn on it every 5 secounds and u can turn it on and off anyways anyone can help me fix this? The code is pretty long just saying
thanks for any help
Code:
options:
time: 5
itembar: |
prefix: &7[&e&lCoil&7]&f&l -
items: 2
variables:
{generator} = true
{mcd} = true
command /gen [<option>] [<gentype>]:
trigger:
if player has permission "generator.admin":
if arg-1 is "give":
if arg-2 is "coal":
give player 1 coal block named "&8&lCoal Generator " with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg-2 is "iron":
give player 1 iron block named "&7&lIron Generator" with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg-2 is "pumpkin":
give player 1 pumpkin named "&6&lPumpkin Generator" with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg-2 is "melon":
give player 1 melon named "&9&Melon Generator" with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg-2 is "wheat":
give player 1 hay named "&c&l Wheat Generator" with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg-2 is "diamond":
give player 1 diamond block named "&b&lDiamond Generator" with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg-2 is "emerald":
give player 1 emerald block named "&a&lEmerald Generator" with lore "{@prefix} &6- &bSneak and mine to pickup"
else:
send "{@prefix} Add a gen type"
if arg 1 is "on":
set {generator} to true
send "{@prefix} &7&lgenerator is on now"
if arg 1 is "off":
set {generator} to false
send "{@prefix} &7&lgenerator is off now"
if arg-1 is "bar":
set {mcd} to false
send "{@prefix} &7&lbar mod on"
if arg-1 is "time":
set {mcd} to true
send "{@prefix} &7&time mod on"
if arg-1 is not set
send "{@prefix} &6- &c/gen [<option>] [<gentype>]"
if arg-2 is not set
send "{@prefix} &6- &cPlease select a valid gen type."
on break of Coal block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {Coalgen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of Iron block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {Irongen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of Pumpkin block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {Pumpkingen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of Melon block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {Melongen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of Redstone block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {redstonegen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of Diamond block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {diamondgen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of Emerald block:
if {generator.%Block%} is true:
if player has permission "generator.admin":
remove location of event-block from {emeraldgen.loc::*}
set {generator.%Block%} to false
delete holo object "%location of block%"
clear {pp%Block%::*}
clear {cc%Block%::*}
on break of coal block:
if %player% is sneaking
set {_loc} to location of block
set block at {_loc} to air
give player 1 coal block named "&b&lCoal &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on break of melon block:
if %player% is sneaking
set {_loc} to location of block
set block at {_loc} to air
give player 1 melon named "&b&lMelon &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on break of pumpkin block:
if %player% is sneaking
set {_loc} to location of block
set block at {_loc} to air
give player 1 pumpkin named "&b&lPumpkin &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on break of iron block:
if %player% is sneaking
set {_loc} to location of block
set block at {_loc} to air
give player 1 coal block named "&b&lIron &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on break of diamond block:
if %player% is sneaking
set {_loc} to location of block
set block at {_loc} to air
give player 1 diamond block named "&b&lDiamond &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on break of emerald block:
if %player% is sneaking
set {_loc} to location of block
set block at {_loc} to air
give player 1 emerald block named "&b&lEmerald &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on break of hay:
if %player5 is sneaking
set {_loc} to location of block
set block at {_loc} to air
give %player% 1 hay named "&b&lWheat &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup"
on place of hay block:
if player's tool is hay named "&b&lWheat &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {wheatgen.loc::*} location of block
spawn diamond above {diamondgen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times:
on place of pumpkin:
if player's tool is diamond block named "&b&lDiamond &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {pumpkingen.loc::*} location of block
spawn pumpkin above {pumpkingen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times:
on place of melon:
if player's tool is melon named "&b&lMelon &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {wheatgen.loc::*} location of block
spawn melon above {diamondgen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times:
on place of coal block:
if player's tool is coal block named "&b&lCoal &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {coalgen.loc::*} location of block
spawn coal above {coalgen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times:
on place of iron block:
if player's tool is iron block named "&b&lIron &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {irongen.loc::*} location of block
spawn iron above {irongen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times:
on place of diamond block:
if player's tool is diamond block named "&b&lDiamond &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {diamondgen.loc::*} location of block
spawn diamond above {diamondgen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times:
on place of emerald block:
if player's tool is emerald block named "&b&lEmerald &bGenerator " with lore "{@prefix} &6- &bSneak and mine to pickup":
set {emeraldgen.loc::*} location of block
spawn emerald above {emeraldgen.loc::*}
set {generator.%Block%} to true
set {gen.%Block%} to {@time}
loop {@time} times: