#Creating a revive beacon

1 messages ¡ Page 1 of 1 (latest)

warm escarp
#

Can someone help me I have no idea where to start

#
    {%player%::Lifes} = 5    

on death of player:
    attacker is a player
    if {%victim%::Lifes} <= 0:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
    else if {%victim%::Lifes} > 0:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}

on join:
    if {%player%::Lifes} <= 0:
        wait 2 seconds
        kick the player due to "&4You are out of Lives. You cannot join back until someone has revived you."

command /Lives:
    trigger:
        message "&7You Have %{%player%::Lifes}% Lives"

command /givelife <offlineplayer>:
    trigger:
        add 1 to {%arg-1%::Lifes}
        message "&7Gave 1 Life to %arg-1%"
command /removelife <offlineplayer>:
    trigger:
        if {%arg-1%::Lifes} > 0:
            remove 1 from {%arg-1%::Lifes}
            message "&7Took 1 Life from %arg-1%"
        else:
            message "&4Cannot remove a life from %arg-1%. They are already out of lives." ```
sweet fulcrum
#

you can't declare that variable there because there is no player

gray willow
#

what is bro blabbin about

#

tf even is a "revive beacon"

warm escarp
#

Have you heard of the lifesteal SMP?

gray willow
#

no, because lifesteal is a terrible gamemode that rewards the winners and punishes the losers, making it exponentially harder to win after taking losses

warm escarp
gray willow
#

that doesn't change how its a terrible gamemode

warm escarp
#

I understand that but basicaly a revive beacon is something used to revive players. Im making this for my smp

gray willow
#

on rightclick on beacon:

warm escarp
#

If i have a custom item for that would it be on rightclick on (itemId):

#

?

#

without parenthesis

gray willow
#

on rightclick on (whatever block you're clicking)

#

then add a condition underneath that checking if the player's tool is (whatever item you want)

warm escarp
#

ohh wait i see thank you!

#

but how would i choose the player to revive? Im not the best at this as you can see.

steep mesa
warm escarp
steep mesa
#

Yeah

warm escarp
#

Im adding custom weapons a few other things

steep mesa
#

nice

warm escarp
#

i just dont know how they choose what player to revive

steep mesa
#

also why not use lists like {blabla::%player%}

#

uhhh

#

Lemme see

warm escarp
#

i just started coding script last week\

steep mesa
#

So you right cliick a beacon and it gives you the option to revive somebody else?

#

From being kicked?

warm escarp
#

from deathban yes

warm escarp
steep mesa
#

yea

#

alr

#

Do you want to do it with a GUI?

#

or sumn

#

Or just player

warm escarp
#

or how to do it

steep mesa
#

Well, idk if it's possible to set so many slots if there's like a thousand people dead

#

but

#

what you would do is

#

when they first get kicked

warm escarp
#

no, its a small private smp

steep mesa
#

alralr

#

when they first get banned, add 1 to a count variable, such as {skriptkicked}
And also add the player to a list such as {skriptplayerskicked::*}

#

Then when that's there

warm escarp
#

uhh

steep mesa
#

like this

warm escarp
steep mesa
#

when they get kicked

add 1 to {kickedcountsk}```
#

Yeah just set {kickedcountsk} in the variables section to 0

warm escarp
#

so like that

steep mesa
#

uhhh

#

lemme see what you're doing 1 second

warm escarp
#
    attacker is a player
    if {%victim%::Lifes} <= 0:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
    else if {%victim%::Lifes} > 1:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}
        add player to {skplayerskicked::*}
        add 1 to {kickedcountsk}```
steep mesa
#

Yeah I'm just seeing

#

No

#

Put those into where you do kick them

warm escarp
#

but

steep mesa
#

so when you kick them it adds to that count

warm escarp
#

then it would loop everytime they try to join

#

oh wait

#

i fliped that

steep mesa
#

yea

warm escarp
#

fixed

steep mesa
#

alr

warm escarp
#
    attacker is a player
    if {%victim%::Lifes} <= 1:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
            add player to {skplayerskicked::*}
        add 1 to {kickedcountsk}
    else if {%victim%::Lifes} > 0:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}```
steep mesa
#

Now you get your detection system of the beacon

warm escarp
steep mesa
#

Why're you sending that they can't?

warm escarp
#

That was temp

steep mesa
#

ah alr

#

just add a comment or sumn if you want to have a temporary

#

whatever

#

So now you want to open up a metadata tag GUI

#

You know how to do that

#

right

warm escarp
#

no 💀 i havent learned any ui

steep mesa
#

like set metadata tag "reviveGUI" of player to chest inventory with 7 rows

warm escarp
#

where do i put that?

#

same spot?

steep mesa
#

after the right click on beacon

warm escarp
#

ok

steep mesa
#

here you should read this

#

probably the best tutorial ever

warm escarp
#
    set metadata tag "reviveGUI" of player to chest inventory with 7 rows named "&4 Revival Gui "
    open (metadata tag "reviveGUI" of player) to player``` so this opens it for the player
#

what do i do about revival?

#

@steep mesa

steep mesa
#

mb

#

I was afk

#

uhhhhh

#

well

#

you need to set the slots

#

which would be

#
  set slot loop-value - 1 of metadata tag "reviveGUI" of player to {skplayerskicked::%loop-value%}'s skull```
#

I believe

warm escarp
#

what about the revive part

steep mesa
#

wdym

warm escarp
#

like when they click that slot

steep mesa
#

Oh that'll be in a bit

warm escarp
#

it revives them

steep mesa
#

it's on inventory click

warm escarp
#

but each slot

steep mesa
#

ah

#

that's true

#

hmmmmm

#

well

#

wait a minute

#

I messed up wait lol

#

I have no idea how you would do that lemme think

warm escarp
steep mesa
#

I'm on the verge of it

warm escarp
warm escarp
steep mesa
#

not yet

warm escarp
#

ok

#

ping me if and when you do

steep mesa
#

alr

slender egret
#

i assume this is a lifesteal thing?
you can place a beacon and then select a dead person to bring back?

warm escarp
#

somewhat

#

yeah

#
    {%player%::Lifes} = 5
    {kickedcountsk} = 0    

on death of player:
    attacker is a player
    if {%victim%::Lifes} <= 1:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
            add player to {skplayerskicked::*}
        add 1 to {kickedcountsk}
    else if {%victim%::Lifes} > 0:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}
on join:
    if {%player%::Lifes} <= 0:
        wait 2 seconds
        kick the player due to "&4You are out of Lives. You cannot join back until someone has revived you."

command /Lives:
    trigger:
        message "&7You Have %{%player%::Lifes}% Lives"

command /givelife <offlineplayer>:
    permission: op
    trigger:
        add 1 to {%arg-1%::Lifes}
        message "&7Gave 1 Life to %arg-1%"
command /removelife <offlineplayer>:
    permission: op
    trigger:
        if {%arg-1%::Lifes} > 0:
            remove 1 from {%arg-1%::Lifes}
            message "&7Took 1 Life from %arg-1%"
        else:
            message "&4Cannot remove a life from %arg-1%. They are already out of lives."
on rightclick on beacon:
    set metadata tag "reviveGUI" of player to chest inventory with 7 rows named "&4 Revival Gui "
    open (metadata tag "reviveGUI" of player) to player
    loop {kickedcountsk} times:
  set slot loop-value - 1 of metadata tag "reviveGUI" of player to {skplayerskicked::%loop-value%}1```
#

yes

slender egret
#

and youre displaying the players in a gui?

warm escarp
#

yes

steep mesa
#

oih wait

#

you gotta name the skull

#

my bad

#

I'll let you do this cause I gotta go afk

slender egret
#

you can do that but if theres more players than slots it'll be more work to make pages than to just have them enter the name in an anvil or something

#

but i do like the visual heads

warm escarp
#

its a private smp so heres like 20 ppl so its a large enough ui

slender egret
#

ah okay

#

are you keeping the dead players in a list?

warm escarp
#

yes

slender egret
#

so then you can use the name of the skull to get them

#

are they the index or value

#
or
add player's uuid to {dead::*}```
warm escarp
#

Each slot tho

#

they are value i think

#

yeah

#

skim the code

#
    {%player%::Lifes} = 5
    {kickedcountsk} = 0    

on death of player:
    attacker is a player
    if {%victim%::Lifes} <= 1:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
            add player to {skplayerskicked::*}
        add 1 to {kickedcountsk}
    else if {%victim%::Lifes} > 0:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}
on join:
    if {%player%::Lifes} <= 0:
        wait 2 seconds
        kick the player due to "&4You are out of Lives. You cannot join back until someone has revived you."

command /Lives:
    trigger:
        message "&7You Have %{%player%::Lifes}% Lives"

command /givelife <offlineplayer>:
    permission: op
    trigger:
        add 1 to {%arg-1%::Lifes}
        message "&7Gave 1 Life to %arg-1%"
command /removelife <offlineplayer>:
    permission: op
    trigger:
        if {%arg-1%::Lifes} > 0:
            remove 1 from {%arg-1%::Lifes}
            message "&7Took 1 Life from %arg-1%"
        else:
            message "&4Cannot remove a life from %arg-1%. They are already out of lives."
on rightclick on beacon:
    set metadata tag "reviveGUI" of player to chest inventory with 7 rows named "&4 Revival Gui "
    open (metadata tag "reviveGUI" of player) to player
    loop {kickedcountsk} times:
  set slot loop-value - 1 of metadata tag "reviveGUI" of player to {skplayerskicked::%loop-value%}```
slender egret
#

i would use {lives::%player's uuid%} and not {%player%::lives}

  • the uuid is like a serial number for a minecraft account
  • {variable::%player%} would (for me) = {variable::x8ight}. Then, if I were to change my username to "bob", any time my information is accessed or saved it will go to {variable::bob} instead of anyhting already saved in {variable::x8ight} (basically if someone changes their username it will wipe their stuff, but a uuid only cares if they are on the same account)
  • putting "lives" before the player makes the player an index in this case, so you can loop it.
    exloop {lives::*}: set loop-value to 100 send "Your life count was set to 100!" to loop-indexyou cant do this if its `{%player%::stuff}
warm escarp
#

Ok, well what about the revival system?

slender egret
#

if you add player's uuid to {deadPlayers::*} when they are dead i would just

  set slot {_n} to loop-value's skull```
warm escarp
slender egret
#

Wdym?

warm escarp
#

like revival

slender egret
#

On inventory click?

warm escarp
#

yeah

#

that

slender egret
#

You use that event, then get the name of the item they clicked on; “%player%’s head”, then you just have to remove the “‘s head”

warm escarp
#

it should?

slender egret
#

If that var is the head

#

If its not you need to add “‘s head”

warm escarp
#

@steep mesa ok help?

steep mesa
#

No idea

#

lol

warm escarp
#

read what he said and put it into simple form?

steep mesa
#

uhhhh

#

idk

#

Not gonna explain rn

#

uhhhh

#

basically

silent crypt
#

hi

#

do I make another post for help?

steep mesa
#

you

#

click new

#

and then create a post

#

:/

warm escarp
silent crypt
#

ik

#

no

warm escarp
#

yoou have no use here you cant help me in any way.

silent crypt
steep mesa
#

you* can't*

#

you*

warm escarp
#

will you please stop

#

LOL*

silent crypt
#

no

steep mesa
#

Laughing out loud

silent crypt
#

you cuss in my post

warm escarp
#

bro im gonna call a mod in

silent crypt
#

I can call a mod

steep mesa
#

alr

warm escarp
#

there are no rules against cussing i dont think

steep mesa
#

They could block it

silent crypt
warm escarp
warm escarp
steep mesa
#

can you stop pinging in replies

silent crypt
#

well its not like I wanted u in my post

#

but yet there u were

warm escarp
steep mesa
#

yes

#

ty

warm escarp
#

np

warm escarp
silent crypt
#

fine

#

apolgize accpeted

#

ik I spelled it wrong

warm escarp
#

spelt

warm escarp
steep mesa
#

not yet

warm escarp
steep mesa
#

alr

#

you can just say @ on

#

lol

#

Anyway

#

basically you can name the skull

#

Like

#

"%{whatever::%loop-value%}%"

#

and then

#

It'll put the player's name in there

#

and then you get the name of the event-item in the on inventory click event and add a life to that player (Or whatever you want to do

warm escarp
steep mesa
#

???

#

I'm helping you

warm escarp
#

send code

#

I know

steep mesa
#

I'm not sending the code

#

just

warm escarp
#

But "%{whatever::%loop-value%}%" is hella confusing

#

variables:
{lives::%player's uuid%} = 5
{kickedcountsk} = 0

on death of player:
attacker is a player
if {%victim%::Lifes} <= 1:
wait 1 second
kick the victim due to "&4You are out of Lives."
add player's uuid to {skplayerskicked::*}
add 1 to {kickedcountsk}
else if {%victim%::Lifes} > 0:
remove 1 from {%victim%::Lifes}
add 1 to {%attacker%::Lifes}
on join:
if {lives::%player's uuid%} <= 0:
wait 2 seconds
kick the player due to "&4You are out of Lives. You cannot join back until someone has revived you."

command /Lives:
trigger:
message "&7You Have %{%lives::%player's uuid%}% Lives"

command /givelife <offlineplayer>:
permission: op
trigger:
add 1 to {%arg-1%::Lifes}
message "&7Gave 1 Life to %arg-1%"
command /removelife <offlineplayer>:
permission: op
trigger:
if {%arg-1%::Lifes} > 0:
remove 1 from {%arg-1%::Lifes}
message "&7Took 1 Life from %arg-1%"
else:
message "&4Cannot remove a life from %arg-1%. They are already out of lives."
on rightclick on beacon:
set metadata tag "reviveGUI" of player to chest inventory with 7 rows named "&4 Revival Gui "
open (metadata tag "reviveGUI" of player) to player
loop {kickedcountsk} times:
set slot loop-value - 1 of metadata tag "reviveGUI" of player‘s head to {skplayerskicked::%loop-value%}
on inventory click:

steep mesa
#

set slot loop-value - 1 of metadata tag "reviveGUI" of player to {skplayerskicked::%loop-value%}'s skull named "%{skplayerskicked::%loop-value}%"

warm escarp
#

ok ty

#

thats what you gave me before

steep mesa
#

nope

#

I put the name in now

warm escarp
#

OH

#

Im stuck on click

#

what did you say to do for that

steep mesa
#

?

#

send_code for the inventory click that you have already

warm escarp
#

for on inventory click:

steep mesa
#

I can't give a pointer I don't know how without your code first lol

#

You have to check the name of event-slot I think

warm escarp
#
    {lives::%player's uuid%} = 5
    {kickedcountsk} = 0    

on death of player:
    attacker is a player
    if {%victim%::Lifes} <= 1:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
            add player's uuid to {skplayerskicked::*}
        add 1 to {kickedcountsk}
    else if {%victim%::Lifes} > 0:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}
on join:
    if {lives::%player's uuid%} <= 0:
        wait 2 seconds
        kick the player due to "&4You are out of Lives. You cannot join back until someone has revived you."

command /Lives:
    trigger:
        message "&7You Have %{%lives::%player's uuid%}% Lives"

command /givelife <offlineplayer>:
    permission: op
    trigger:
        add 1 to {%arg-1%::Lifes}
        message "&7Gave 1 Life to %arg-1%"
command /removelife <offlineplayer>:
    permission: op
    trigger:
        if {%arg-1%::Lifes} > 0:
            remove 1 from {%arg-1%::Lifes}
            message "&7Took 1 Life from %arg-1%"
        else:
            message "&4Cannot remove a life from %arg-1%. They are already out of lives."
on rightclick on beacon:
    set metadata tag "reviveGUI" of player to chest inventory with 7 rows named "&4 Revival Gui "
    open (metadata tag "reviveGUI" of player) to player
    loop {kickedcountsk} times:
  set slot loop-value - 1 of metadata tag "reviveGUI" of player‘s head to {skplayerskicked::%loop-value%}
    on inventory click:
steep mesa
#

wait why is the on inventory click indented

warm escarp
#

idk

#

accidental

steep mesa
#

anyway

#

if event-inventory = (metadata tag "reviveGUI" of player):

warm escarp
#

So what do i do from there like give me a pointer

#

I dont need code

steep mesa
#

You then check the name of the item in that slot

#

And if the list contains that item

#

then you give that player

#

the one life

warm escarp
#

how do i checl the name of an item?

steep mesa
#

I think it's name of event-slot

#

I don't know tho

warm escarp
#

Yep

steep mesa
#

Use the parser if you want it's very useful

warm escarp
#

Wdym?

#

i dont know of a parser

steep mesa
#

so useful dude

#

It literally just parses your code

#

So you don't have to paste the skript

gray willow
#

its better to do it on your own server if its already running

warm escarp
#
if event-inventory = (metadata tag "reviveGUI" of player):
    add 1 to name of event-slot```

is this right?
gray willow
#

but if you don't feel like booting one up or aren't able to, the parser is better than nothing

warm escarp
#

i can test it very fast

warm escarp
#

Error on
Line 2
Goto Line
Can't understand the type 'player's uuid'
{lives::%player's uuid
Error on
Line 10
Goto Line
indentation error: expected 8 spaces, but found 12 spaces
add player's uuid to {skplayerskicked::*}
Error on
Line 22
Goto Line
Invalid amount or placement of brackets. Please make sure that each opening bracket has a corresponding closing bracket.
message "&7You Have %{%lives::%player's uuid%}% Lives"
Warning on
Line 40
Goto Line
Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
loop {kickedcountsk} times:
Error on
Line 41
Goto Line
indentation error: expected 8 spaces, but found 2 spaces
set slot loop-value - 1 of metadata tag "reviveGUI" of player‘s head to {skplayerskicked::%loop-value%}
Warning on
Line 42
Goto Line
Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section.
on inventory click:
Error on
Line 43
Goto Line
can't understand this event: 'if event-inventory = (metadata tag "reviveGUI" of player)'
if event-inventory = (metadata tag "reviveGUI" of player):

#

god damn

steep mesa
#

Cause then you can catch logic errors

#

what

#

I have no idea

#

my brain isn't working

warm escarp
#

fr

#

Can't understand the type 'player's uuid'
{lives::%player's uuid

steep mesa
#

You forgot to close it

warm escarp
#

i didnt

steep mesa
#

And your indentation is messed up

warm escarp
#

{lives::%player's uuid%} = 5

#

variables:
{lives::%player's uuid%} = 5
{kickedcountsk} = 0

steep mesa
#

Ohhh

warm escarp
#

Oh wait , right?

steep mesa
#

I don't know why, but I've had an error where you can't set a var for player's uuid for some reason

#

in variables section

#

Just set it on first join

#

so

#
  {lives::%player's uuid%} isn't set
  set {lives::%player's uuid%} to 5```
#

And remove it from the variables section

warm escarp
#
message "&7You Have %{%lives::%player's uuid%}% Lives"```
steep mesa
#

oops

#

you can't have the % before lives

#

remove that

#

and put it before the bracket

warm escarp
#

oops

steep mesa
#

oh wait

#

you already did that

warm escarp
#

Can't understand this condition/effect: set slot loop-value - 1 of metadata tag "reviveGUI" of player`s head to {skplayerskicked::%loop-value%} set slot loop-value - 1 of metadata tag "reviveGUI" of player`s head to {skplayerskicked::%loop-value%}

steep mesa
#

I have no idea

#

prob

#

what

#

did you do

#

wait did I type that

warm escarp
#

nothing

steep mesa
#

you messed up

#

you typed 'of player's head'

warm escarp
#

the name of event-slot can't have anything added to it
add 1 to name of event-slot

steep mesa
#

what?

#

Why would you add 1 to the name?????

warm escarp
#

idk

#

i kinda realised that as i sent it 💀

steep mesa
#

...

#

aight imma go take a shower ig

warm escarp
#

Alr

steep mesa
#

alr

warm escarp
#
add 1 to {lives::name of event-slot}``` thought this might work but no ```add 1 to {lives::name of event-slot}```
#
set slot loop-value - 1 of metadata tag "reviveGUI" of player to {skplayerskicked::%loop-value%}'s skull named "%{skplayerskicked::%loop-value}%"```
steep mesa
#

what

#

???

#

nononono

#

you gotta like

warm escarp
#

i have no idea what im doing 💀

steep mesa
#

whatever lol

warm escarp
#

take ur shower and when your out come back

#

dont waste ur time on me

steep mesa
warm escarp
#

test

#

oops mb didnt mean to ping

steep mesa
#

?

#

It's alr

#

wdym

#

ohhh

#

I can't rn

warm escarp
#

alr

steep mesa
#

send your code

#

I can check for logic errors

warm escarp
#
    {lives::%player's uuid%} = 5
    {kickedcountsk} = 0    

on death of player:
    attacker is a player
    if {%victim%::Lifes} <= 1:
        wait 1 second
        kick the victim due to "&4You are out of Lives."
            add player's uuid to {skplayerskicked::*}
        add 1 to {kickedcountsk}
    else if {%victim%::Lifes} > 0:
        remove 1 from {%victim%::Lifes}
        add 1 to {%attacker%::Lifes}
on join:
    if {lives::%player's uuid%} <= 0:
        wait 2 seconds
        kick the player due to "&4You are out of Lives. You cannot join back until someone has revived you."

command /Lives:
    trigger:
        message "&7You Have %{%lives::%player's uuid%}% Lives"

command /givelife <offlineplayer>:
    permission: op
    trigger:
        add 1 to {%arg-1%::Lifes}
        message "&7Gave 1 Life to %arg-1%"
command /removelife <offlineplayer>:
    permission: op
    trigger:
        if {%arg-1%::Lifes} > 0:
            remove 1 from {%arg-1%::Lifes}
            message "&7Took 1 Life from %arg-1%"
        else:
            message "&4Cannot remove a life from %arg-1%. They are already out of lives."
on rightclick on beacon:
    set metadata tag "reviveGUI" of player to chest inventory with 7 rows named "&4 Revival Gui "
    open (metadata tag "reviveGUI" of player) to player
    loop {kickedcountsk} times:
  set slot loop-value - 1 of metadata tag "reviveGUI" of player‘s head to {skplayerskicked::%loop-value%}
on inventory click:
if event-inventory = (metadata tag "reviveGUI" of player):
    add 1 to name of event-slot```
#

BRO

steep mesa
#

any errors?

warm escarp
#

IT WENT BACK TO THE OLD VERSION

#

SHIT

steep mesa
#

what

#

Oof

#

imma get off of pc

#

for now

#

ill be on phone

warm escarp
#

ima go to sleep

steep mesa
#

K

warm escarp
#

gn