#I want to make a defence block script , but i have no idea in making it

1 messages · Page 1 of 1 (latest)

runic meadow
#

?

wicked folio
#

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

#
vivid moth
#

What’s the idea

#

K

wicked folio
#

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?

vivid moth
#

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

vivid moth
#

im not spoonfeeding

buoyant trail
#

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!"
buoyant trail
#

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

frank warren
#

bros making a raid gen server

buoyant trail
frank warren
#

my bomb skript was actualy fire

#

2 sec ill find a vid

buoyant trail
#

me too, but back when i was so bad i couldnt do it

frank warren
#

heres the one i made

#

thers sound u jus cant hear it

buoyant trail
frank warren
#

its my server

#

stealgens is trash

#

genust is trash

buoyant trail
#

true

frank warren
#

stealable is trash

buoyant trail
#

nah stealable is ok

frank warren
#

fast notes is trash

#

daunted was the only good one

buoyant trail
#

dialed you know bankforge? it was like 2021, my first time playing a raid server

#

that servers was fire

frank warren
#

eh

#

shi this makes me want to work on mine again

buoyant trail
frank warren
#

i could hoensntly do it, its just soi much work

buoyant trail
frank warren
buoyant trail
#

i can understand kacper skripts

#

if that helps you in any way

frank warren
#

waht

#

kacper?

buoyant trail
#

okay thought you knew kacper

#

my bad

frank warren
#

who?

buoyant trail
#

its my daddy

frank warren
#

wahts ur server looking like rn

buoyant trail
#
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

frank warren
#

just nbt to store the owner

buoyant trail
#

yeah but he is using it

frank warren
#

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

buoyant trail
#

yoo that looks pretty nice

frank warren
#

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

buoyant trail
#

with nbt compounds?

frank warren
#

yea

buoyant trail
#

just learn basic skript

frank warren
#

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

buoyant trail
#

if you cant do a gen server without receiving a lot of help i would consider some easier projects to learn skript

frank warren
#

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

buoyant trail
#

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

frank warren
#

bruh is it defense or defence

#

wit a s or c?

buoyant trail
#

c

frank warren
#

nah i had to go

#

im texting on my phone rn

frank warren
#

waht

#

even if i made it i wouldnt recommend u using it

frank warren
#

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

#

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

buoyant trail
#

real