#I want to make a defence block script , but i have no idea in making it
1 messages · Page 1 of 1 (latest)
be more specific on what you are looking for
ie how would i make a hologram in skript
just be more specific on what you need help with
so then store the health as a number on the block using something like metadata or nbt
and use the break event, cancel and remove 1 from that value
i suggest first looking at the invididual parts of it so you can get familiar and then try combing it all together
https://skripthub.net/docs/?id=2622
https://skripthub.net/docs/?id=996
https://skripthub.net/docs/?id=1105
Metadata is a way to store temporary data on entities, blocks and more that disappears after a server restart.
Called when a block is broken by a player. If you use 'on mine', only events where the broken block dropped something will call the trigger.
set metadata vale "health" of ... to 500
then you can just use metadata "value" of ... to reference it later
... being whatever you want to store it on, such as a block
why not set the value in the place event??
and then modify it in the break event?
set it when you place the block
this sets that metadata to every block you place
needs to be after your check
send code
metadata need indentation
i'd suggest learn basic skript
im not spoonfeeding
you cant just assume the placed block is cracked stone bricks
use event-block
yes
also how Layton said, you need to do indentation, like you did in the command above
With indentation:
command /example:
trigger:
send "&7Wow!"
Without indentation:
command /example:
trigger:
send "&7Wow!"
okay first, ever block you do now gets the metadata of "health" because you put the if name of player's held item contains "&eDefenceBlock": at the end
also, you should cancel the event, so the block doesn't get broken
@buoyant trail
make a if statement if the metadata health is set, and if yes, put the cancel event
on place:
if name of player's held item contains "&eDefenceBlock":
set metadata "health" of targeted block to 500
also, you shouldn't do set {_meta} to metadata "health" of targeted block because if you remove 1 from {_meta} its not gonna remove if from metadata "health" of targeted block
and use event-block not targeted block
you forgot the ":"
no wait
you didnt
send me the code
every time you have a ":" you need to do intendation
command /blockgive [<player>] [<text>]:
trigger:
if player has permission "block.give":
if arg-2 is "DefenceBlock":
give arg-1 cracked stone bricks named "&eDefenceBlock"
on place of cracked stone bricks:
if name of player's held item contains "&eDefenceBlock":
set metadata "health" of targeted block to 500
on break of cracked stone bricks:
set {_meta} to metadata "health" of event-block
remove 1 from {_meta}
send "&cHeal: &f%{_meta}%" to player
if {_meta} is 0:
delete metadata "health" of event-block
delete targeted block
because i did the indentation manually, you can automate stuff like that with visual studio code
it has that feature
command /blockgive [<player>] [<text>]:
trigger:
if player has permission "block.give":
if arg-2 is "DefenceBlock":
give arg-1 cracked stone bricks named "&eDefenceBlock"
on place of cracked stone bricks:
if name of player's held item contains "&eDefenceBlock":
set metadata "health" of targeted block to 500
on break of cracked stone bricks:
set {_meta} to metadata "health" of event-block
remove 1 from {_meta}
send "&cHeal: &f%{_meta}%" to player
if {_meta} is 0:
delete metadata "health" of event-block
delete targeted block
okay so this is with visual studio code, it will still not work, but should reload with no errors
because you still didnt fix the temp var problem
you still didnt add the cancel event like i told you
do an if statement, check if the block has the metadata "health" and put it after if the block does have
you just call it that, i dont know the lore
bros making a raid gen server
probably
shi i attempted one of those
my bomb skript was actualy fire
2 sec ill find a vid
me too, but back when i was so bad i couldnt do it
fire 🥶🥶🥶
true
stealable is trash
nah stealable is ok
dialed you know bankforge? it was like 2021, my first time playing a raid server
that servers was fire
this is a bug on bankforge.minehut.gg credid for DeathlyTaco for showing me this bug
i could hoensntly do it, its just soi much work
lets do one together
how good are u at skript
who?
its my daddy
wahts ur server looking like rn
on break of cracked stone bricks:
if (metadata "health" of event-block) is set:
remove 1 from (metadata "health" of event-block)
send "&cHeal: &f%(metadata "health" of event-block)%" to player
if (metadata "health" of event-block) is 0:
delete metadata "health" of event-block
set block at location of event-block to air
I think this version should work
i mean its not soft coded overall but if you starting at skript its okay
u dont need metadata for this
just nbt to store the owner
yeah but he is using it
just use nbt to store owner/who can interact wit it (like pick it up)
then wtv ur using for bombs just do
on place
check tool of player (make sure its a bomb)
check the event-block (make sure its a defense block)
then do ur explosion or wtv
let me find my code for that vid
making a raid gen server which i never finished got my into skript actualy
my recomendation is to work on smaller projects before attempting a full server
whose ur friend
also just found the vid of my gen system.
couldnt find my vid, but heres a vid of another person wit the same gen system that i made
@buoyant trail
yoo that looks pretty nice
just an armor stand
wit a bit of uuid storing on the main block as nbt
lol
u would be surprsied wit the stuff u can do in skript
i made a gui creator a few weeks ago actualy. generates the code for u
#showcase message
yea, remember few months ago minehut went into maintence for liek 2 weeks, i just decided i wasnt gonna wait that and got the first hosting i could
waht are u tryna do rn anyway
fr, as soon as u learn some reflect, and api which is actualy pretty easy, u can do a lot of things, like wit api u can send texts to ur phone wit skript,
normal skript isnt that powerful but addons let u do alot of things
yes
dont use metadata
metadata gets deleted after a server restart, so once server restarts literaly everything gets deleted
nbt?
nbt lowkey takes a while to learn, check out the wiki for that
and if i was u i would take some time to really learn a good amount of skript
or tell ur friend that
nbt isnt sum u jus add
nbt is similar to metadata
it stores data on the block itself
with nbt compounds?
yea
just learn basic skript
its not rlly sum i can help wit, i would recommend u go to the skbee wiki tho and check out the 3 sections on nbt
i wouldnt consider nbt basic lowkey
if you cant do a gen server without receiving a lot of help i would consider some easier projects to learn skript
bosa
give me 2 sec, im coding a soft coded version for some u can use, its gonna be a lil advanced so ur gonna need to learn nbt
bro i purchased the raid gen server template from minehut market back when that was a thing in 2021, looking back its so fucking bad skripted
i dunno sum credits i forgot
yea
u needa redo it all
metadata doesnt save after a server restart, legit it will all be deleted
imagine everyones defense gets deleted
not worth it just store it a dif way
u can also use lists wit the location
like
{PlacedDefense::%uuid of player%::%event-location%}
then just check if
{{PlacedDefense::%uuid of player%::*} contains location of event-block on break to check if the player is the owner
i would just use nbt tho
then learnnnnnnn
theres the intro to nbt
heres everything abt nbt compounds
https://github.com/ShaneBeee/SkBee/wiki/NBT-Compound
start wit 1, then go ingame and try to use some of the code and see waht it does
then move onto 2
then 3
and repeat that go ingame and test thing
cause thats the best way to learn
there not
oh wait
i sent wrong link lol
my fualt
real