Skocz do zawartości
  • 0

LifeMC+Receptury


norekxd65

Pytanie

Witam, 
posiadam skrypt LifeMC ( życia) i skrypt na receptury . I chciałbym się dowiedzieć czy mozna zrobic tak : 
Życia można dodawać jedząc diamenty ( lub to co jest ustawione  w configu LifeMc), a jeżeli w skrypcie od receptur zrobie np. Mega Diament to jak moge to ustawić żeby dodawało życie po jego zjedzeniu

Odnośnik do komentarza
https://skript.pl/temat/8760-lifemcreceptury/
Udostępnij na innych stronach

8 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

options:

Initial_Lives: 3 #Poczatkowa ilosc zyc

Max_Lives: 10 #Maksymalna ilosc zyc

Death_Worlds: "world" or "world_nether" #Swiaty w ktorych dziala skrypt. Aby dodac nowy swiat dopisz 'or "swiat"'

Action_Item: ghast tear #Przedmiot, ktory dodaje zycia

Items_per_Life: 3 #Ile przedmiotow trzeba uzyc aby zdobyc 1 zycie.

on connect:

if {LifeMC::lives::%player%} is 0:

kick player due to "&cYou lost all your lives. You cannot join the server."

stop

on join:

wait a tick

if {LifeMC::lives::%player%} is not set:

set {LifeMC::counter::%player%} to 0

set {LifeMC::lives::%player%} to {@Initial_Lives}

send "&a[LifeMC] &bYou have received &c{@Initial_Lives} &blives. Good Luck!"

stop

Send "&a[LifeMc] &bWelcome back, You have &c%{LifeMC::lives::%player%}% &blives left."

if {LifeMC::savior::%player%} is set:

send "&a[LifeMC] &bYou have been revived by &6%{LifeMC::savior::%player%}%&b."

clear {LifeMC::savior::%player%}

stop

on death of player:

if victim is in world {@Death_Worlds}:

wait a tick

remove 1 from {LifeMC::lives::%victim%}

if {LifeMC::lives::%victim%} is not 0:

send "&a[LifeMC] &bYou died and lost a life. You have &c%{LifeMC::lives::%victim%}% &blives left." to victim

stop

set death message to ""

broadcast "&a[LifeMC] &6%victim% &blost all his lives. If you want to revive him type &c""/revive %victim%""&b."

kick victim due to "&cYou lost all your lives."

stop

on rightclick holding {@Action_Item}:

if {LifeMC::lives::%player%} is {@Max_Lives}:

send "&a[LifeMC] &cYou have the maximum amount of lives."

stop

add 1 to {LifeMC::counter::%player%}

remove 1 {@Action_Item} from player

if {LifeMC::counter::%player%} is {@Items_per_Life}:

add 1 to {LifeMC::lives::%player%}

set {LifeMC::counter::%player%} to 0

send "&a[LifeMC] &bYou got an extra life. You have &c%{LifeMC::lives::%player%}% &blives now."

stop

command /revive [<offlineplayer>]:

aliases: ulecz

description: Revives specific player.

trigger:

if player doesn't have the permission "lifemc.revive":

send "&a[LifeMC] &cYou do not have the required permissions."

stop

if arg is not set:

send "&a[LifeMC] &cCorrect usage: &7/revive <player>"

stop

if {LifeMC::lives::%arg%} is not set:

send "&a[LifeMC] &cThe player &6%arg% &cdoes not exist!"

stop

if {LifeMC::lives::%arg%} is more than 0:

send "&a[LifeMC] &cThe player &6%arg% &cdoes not need your help!"

stop

if {LifeMC::lives::%player%} is 1:

send "&a[LifeMC] &cYou have only &c1 life left!"

stop

add 1 to {LifeMC::lives::%arg%}

set {LifeMC::savior::%arg%} to player

remove 1 from {LifeMC::lives::%player%}

send "&a[LifeMC] &bYou revived &6%arg%&b. You have &c%{LifeMC::lives::%player%}% &blives left."

stop

command /lives [<offlineplayer=%player%>]:

aliases: zycia

description: Shows current amount of lives.

trigger:

if player doesn't have the permission "lifemc.lives":

send "&a[LifeMC] &cYou do not have the required permissions."

stop

if {LifeMC::lives::%arg%} is not set:

send "&a[LifeMC] &cThe player &6%arg% &cdoes not exist!"

stop

if arg is "%player%":

send "&a[LifeMC] &bYou have &c%{LifeMC::lives::%arg%}% &blives left."

stop

else:

if player doesn't have the permission "lifemc.lives.other":

send "&a[LifeMC] &cYou do not have the required permissions."

stop

send "&a[LifeMC] &bThe player &6%arg% &bhas &c%{LifeMC::lives::%arg%}% &blives left."

stop

command /givelife [<offlineplayer>] [<number>]:

aliases: daj

description: Gives specific amount of life to a specific player.

trigger:

if player doesn't have the permission "lifemc.give":

send "&a[LifeMC] &cYou do not have the required permissions."

stop

if arg 1 is not set:

send "&a[LifeMC] &cCorrect usage: &7/givelife <player> <amount>"

stop

if arg 2 is not set:

send "&a[LifeMC] &cCorrect usage: &7/givelife <player> <amount>"

stop

if {LifeMC::lives::%arg 1%} is not set:

send "&a[LifeMC] &cThe player &6%arg 1% &cdoes not exist!"

stop

add arg 2 to {LifeMC::lives::%arg 1%}

send "&a[LifeMC] &bYou gave &c%arg 2% &blives to the player &6%arg 1%&b. He has &c%{LifeMC::lives::%arg 1%}% &blives now."

stop

 

Edytowane przez norekxd65
Odnośnik do komentarza
https://skript.pl/temat/8760-lifemcreceptury/#findComment-68084
Udostępnij na innych stronach

  • 0

O kurczę, toż to przecież mój skrypt :D


 


Proszę, dodałem opcję zmiany nazwy przedmiotu:


 


//Edit, dodałem Crafting



options:
Initial_Lives: 3 #Poczatkowa ilosc zyc
Max_Lives: 10 #Maksymalna ilosc zyc
Death_Worlds: "world" or "world_nether" #Swiaty w ktorych dziala skrypt. Aby dodac nowy swiat dopisz 'or "swiat"'
Action_Item: diamond #Przedmiot, ktory dodaje zycia
Action_Item_Name: "&3Mega Diamond" #Nazwa przedmiotu
Items_per_Life: 3 #Ile przedmiotow trzeba uzyc aby zdobyc 1 zycie.
#Crafting
item1: diamond
item2: diamond
item3: diamond
item4: diamond
item5: golden apple
item6: diamond
item7: diamond
item8: diamond
item9: diamond
on script load:
register new shaped recipe for {@Action_Item} named {@Action_Item_Name} using {@item1}, {@item2}, {@item3}, {@item4}, {@item5}, {@item6}, {@item7}, {@item8}, {@item9}
on connect:
if {LifeMC::lives::%player%} is 0:
kick player due to "&cYou lost all your lives. You cannot join the server."
stop
on join:
wait a tick
if {LifeMC::lives::%player%} is not set:
set {LifeMC::counter::%player%} to 0
set {LifeMC::lives::%player%} to {@Initial_Lives}
send "&a[LifeMC] &bYou have received &c{@Initial_Lives} &blives. Good Luck!"
stop
send "&a[LifeMc] &bWelcome back. You have &c%{LifeMC::lives::%player%}% &blives left."
if {LifeMC::savior::%player%} is set:
send "&a[LifeMC] &bYou have been revived by &6%{LifeMC::savior::%player%}%&b."
clear {LifeMC::savior::%player%}
stop
on death of player:
if victim is in world {@Death_Worlds}:
wait a tick
remove 1 from {LifeMC::lives::%victim%}
if {LifeMC::lives::%victim%} is not 0:
send "&a[LifeMC] &bYou died and lost a life. You have &c%{LifeMC::lives::%victim%}% &blives left." to victim
stop
set death message to ""
broadcast "&a[LifeMC] &6%victim% &blost all his lives. If you want to revive him type &c""/revive %victim%""&b."
kick victim due to "&cYou lost all your lives."
stop
on rightclick holding {@Action_Item}:
if name of player's tool is {@Action_Item_Name}:
if {LifeMC::lives::%player%} is more than or equal to {@Max_Lives}:
send "&a[LifeMC] &cYou have the maximum amount of lives."
stop
add 1 to {LifeMC::counter::%player%}
remove 1 {@Action_Item} named {@Action_Item_Name} from player
if {LifeMC::counter::%player%} is {@Items_per_Life}:
add 1 to {LifeMC::lives::%player%}
set {LifeMC::counter::%player%} to 0
send "&a[LifeMC] &bYou got an extra life. You have &c%{LifeMC::lives::%player%}% &blives now."
stop
command /revive [<offlineplayer>]:
aliases: ulecz
description: Revives specific player.
trigger:
if player doesn't have the permission "lifemc.revive":
send "&a[LifeMC] &cYou do not have the required permissions."
stop
if arg is not set:
send "&a[LifeMC] &cCorrect usage: &7/revive <player>"
stop
if {LifeMC::lives::%arg%} is not set:
send "&a[LifeMC] &cThe player &6%arg% &cdoes not exist!"
stop
if sender is console:
add 1 to {LifeMC::lives::%arg%}
set {LifeMC::savior::%arg%} to "CONSOLE"
send "&a[LifeMC] &bYou revived &6%arg%&b."
stop
if {LifeMC::lives::%arg%} is more than 0:
send "&a[LifeMC] &cThe player &6%arg% &cdoes not need your help!"
stop
if {LifeMC::lives::%player%} is 1:
send "&a[LifeMC] &cYou have only &c1 life left!"
stop
add 1 to {LifeMC::lives::%arg%}
set {LifeMC::savior::%arg%} to player
remove 1 from {LifeMC::lives::%player%}
send "&a[LifeMC] &bYou revived &6%arg%&b. You have &c%{LifeMC::lives::%player%}% &blives left."
stop
command /lives [<offlineplayer=%player%>]:
aliases: zycia
description: Shows current amount of lives.
trigger:
if player doesn't have the permission "lifemc.lives":
send "&a[LifeMC] &cYou do not have the required permissions."
stop
if {LifeMC::lives::%arg%} is not set:
send "&a[LifeMC] &cThe player &6%arg% &cdoes not exist!"
stop
if arg is "%player%":
send "&a[LifeMC] &bYou have &c%{LifeMC::lives::%arg%}% &blives left."
stop
else:
if player doesn't have the permission "lifemc.lives.other":
send "&a[LifeMC] &cYou do not have the required permissions."
stop
send "&a[LifeMC] &bThe player &6%arg% &bhas &c%{LifeMC::lives::%arg%}% &blives left."
stop

command /givelife [<offlineplayer>] [<number>]:
aliases: dajzycie
description: Gives specific amount of life to a specific player.
trigger:
if player doesn't have the permission "lifemc.give":
send "&a[LifeMC] &cYou do not have the required permissions."
stop
if arg 1 is not set:
send "&a[LifeMC] &cCorrect usage: &7/givelife <player> <amount>"
stop
if arg 2 is not set:
send "&a[LifeMC] &cCorrect usage: &7/givelife <player> <amount>"
stop
if {LifeMC::lives::%arg 1%} is not set:
send "&a[LifeMC] &cThe player &6%arg 1% &cdoes not exist!"
stop
add arg 2 to {LifeMC::lives::%arg 1%}
send "&a[LifeMC] &bYou gave &c%arg 2% &blives to the player &6%arg 1%&b. He has &c%{LifeMC::lives::%arg 1%}% &blives now."
stop
command /test:
trigger:
set {LifeMC::lives::%player%} to 2
Edytowane przez Shooterowy
Odnośnik do komentarza
https://skript.pl/temat/8760-lifemcreceptury/#findComment-68229
Udostępnij na innych stronach

  • 0

Crafting nie działa :o


 


 


Jeżeli pomoże :) 



[13:47:21 ERROR]: [Skript] indentation error: indent must only consist of either spaces or tabs, but not mixed (found '->_' [-> = tab, _ = space, ? = other whitespace]) (zyciaaaa.sk, line 55: register new shaped recipe for {@Action_Item} named {@Action_Item_Name} using {@item1}, {@item2}, {@item3}, {@item4}, {@item5}, {@item6}, {@item7}, {@item8}, {@item9}')
Edytowane przez norekxd65
Odnośnik do komentarza
https://skript.pl/temat/8760-lifemcreceptury/#findComment-68274
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...