Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Naprawa skryptu na cuboid


rzy4y

Rekomendowane odpowiedzi

Opublikowano

Witam prosiłbym o naprawę skryptu/ulepszenie na cuboidy.

Problem polega na tym, że wszystko pięknie działa ale gdy się wpisze komendę /cub stworz [id] to powinno pobierać 1, 2 lub 3 diamenty (zależnie od rozmiarów terenu)

a drugi problem polega na tym, że gracz może zrobić cuboida na cuboidzie innego gracza.

 

oto skrypt: https://code.skript.pl/SjuqZOwA/

HTBCzoQ.png


Chcesz żebym zobaczył co nabazgrałeś?


dodaj @rzy4y do posta to zobacze :)


if player has name "rzy4y"


Execute command: /Give a like


Opublikowano

W skrypcie jest "głupi błąd" :

 

podczas tworzenia cuboida :

remove 32 emerlad from player

 

Zamieniłem na diamenty .

Ps. zamoast remove xx xxxx from player używaj remove xx xxxx from player's inventory 

 

Masz tu poprawiony skrypt :

variables:
        {cub.set.%player%} = false
        {cub.tp.%player%} = false
 
command /cuboid [<text>] [<text>]:
        permission: lckm.cub
        aliases: cub
        trigger:
                if arg 1 is "list":
                        if arg 2 is not set:
                                send "&7&m================&7[&3CUB&7]&7&m================"
                                send "&7[ &3NR&7 ]   [ &3CENA&7 ]                       [ &3WYMIARY&7 ]"
                                send "&7    1         1 Diamond           -              10x10"
                                send "&7    2         2 Diamond           -              20x20"
                                send "&7    3         3 Diamond          -              30x30"
                                send "&cPrzy zakladaniu (/cuboid zaloz [ID]) podaj"
                                send "&c                 numer typu (1-3)!"
                                send "&7&m===================================="
                if arg 1 is "zaloz" or "stworz":
                        if arg 2 is "1":
                                if {cub.set.%player%} is false:
                                        if player has 1 diamond:
                                                set {pos%player%} to location of player
                                                set {pos1%player%} to {pos%player%}
                                                set {cub.set.%player%} to true
                                                set {cubdom.%player%} to location of player
                                                wait 1 second
                                                remove 1 diamond from player's inventory
                                                execute console command "pex user %name of player% add worldedit.*"
                                                execute console command "pex user %name of player% add worldguard.*"
                                                execute player command "//pos1"
                                                execute player command "//pos2"
                                                execute player command "//expand 5 n"
                                                execute player command "//expand 5 s"
                                                execute player command "//expand 5 w"
                                                execute player command "//expand 5 e"
                                                execute player command "//expand vert"
                                                execute player command "rg define %name of player%"
                                                execute player command "rg addowner %name of player% %name of player%"
                                                execute player command "rg flag %name of player% chest-access deny"
                                                execute player command "rg flag %name of player% pvp deny"
                                                execute player command "rg flag %name of player% lava-fire deny"
                                                execute player command "rg flag %name of player% tnt deny"
                                                execute player command "rg flag %name of player% creeper-explosion deny"
                                                execute player command "rg flag %name of player% other-explosion deny"
                                                execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%"
                                                execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!"
                                                execute console command "pex user %name of player% remove worldedit.*"
                                                execute console command "pex user %name of player% remove worldguard.*"
                                                loop 99 times:
                                                        send ""
                                                wait 1 second
                                                send "&3&o>> &7Stworzyles teren &31 &7o wymiarach &310x10&7!" to player
                                                broadcast "&3&o>> &7Gracz &3%player% &7zalozyl teren &31&7!"
                                        else:
                                                send "&3&o>> &7Nie masz &31 Diamentu&7!"
                                                stop
                        if arg 2 is "2":
                                if player has 2 diamond:
                                        set {pos%player%} to location of player
                                        set {pos1%player%} to {pos%player%}
                                        set {cub.set.%player%} to true
                                        set {cubdom.%player%} to location of player
                                        wait 1 second
                                        remove 2 diamond from player's inventory
                                        execute console command "pex user %name of player% add worldedit.*"
                                        execute console command "pex user %name of player% add worldguard.*"
                                        execute player command "//pos1"
                                        execute player command "//pos2"
                                        execute player command "//expand 10 n"
                                        execute player command "//expand 10 s"
                                        execute player command "//expand 10 w"
                                        execute player command "//expand 10 e"
                                        execute player command "//expand vert"
                                        execute player command "rg define %name of player%"
                                        execute player command "rg addowner %name of player% %name of player%"
                                        execute player command "rg flag %name of player% chest-access deny"
                                        execute player command "rg flag %name of player% pvp deny"
                                        execute player command "rg flag %name of player% lava-fire deny"
                                        execute player command "rg flag %name of player% tnt deny"
                                        execute player command "rg flag %name of player% creeper-explosion deny"
                                        execute player command "rg flag %name of player% other-explosion deny"
                                        execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%"
                                        execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!"
                                        execute console command "pex user %name of player% remove worldedit.*"
                                        execute console command "pex user %name of player% remove worldguard.*"
                                        loop 99 times:
                                                send ""
                                        wait 1 second
                                        send "&3&o>> &7Stworzyles teren &32 &7o wymiarach &320x20&7!" to player
                                        broadcast "&3&o>> &7Gracz &3%player% &7zalozyl teren &32&7!"
                                else:
                                        send "&3&o>> &7Nie masz &32 Diamentów&7!"
                                        stop
                        if arg 2 is "3":
                                if player has 3 diamond:     
                                        set {pos%player%} to location of player
                                        set {pos1%player%} to {pos%player%}
                                        set {cub.set.%player%} to true
                                        set {cubdom.%player%} to location of player
                                        wait 1 second
                                        remove 3 diamond from player's inventory
                                        execute console command "pex user %name of player% add worldedit.*"
                                        execute console command "pex user %name of player% add worldguard.*"
                                        execute player command "//pos1"
                                        execute player command "//pos2"
                                        execute player command "//expand 15 n"
                                        execute player command "//expand 15 s"
                                        execute player command "//expand 15 w"
                                        execute player command "//expand 15 e"
                                        execute player command "//expand vert"
                                        execute player command "rg define %name of player%"
                                        execute player command "rg addowner %name of player% %name of player%"
                                        execute player command "rg flag %name of player% chest-access deny"
                                        execute player command "rg flag %name of player% pvp deny"
                                        execute player command "rg flag %name of player% lava-fire deny"
                                        execute player command "rg flag %name of player% tnt deny"
                                        execute player command "rg flag %name of player% creeper-explosion deny"
                                        execute player command "rg flag %name of player% other-explosion deny"
                                        execute player command "rg flag %name of player% greeting &3&o>> &7Cuboid gracza &3%player%"
                                        execute player command "rg flag %name of player% farewell &3&o>> &7Teren publiczny!"
                                        execute console command "pex user %name of player% remove worldedit.*"
                                        execute console command "pex user %name of player% remove worldguard.*"
                                        loop 99 times:
                                                send ""
                                        wait 1 second
                                        send "&3&o>> &7Stworzyles teren &33 &7o wymiarach &330x30&7!" to player
                                        broadcast "&3&o>> &7Gracz &3%player% &7zalozyl teren &33&7!"
                                else:
                                        send "&3&o>> &7Nie masz &33 Diamentów&7!"
                                        stop
                if arg 1 is "dodaj":
                        if arg 2 is set:
                                execute console command "pex user %name of player% add worldguard.*"   
                                execute player command "rg addmember %name of player% %arg 2%"
                                execute console command "pex user %name of player% remove worldguard.*"
                                send "&3&o>> &7Dodales gracza &3%arg 2% &7do terenu!"
                        else:
                                send "&3&o>> &7Podaj nick gracza!"
                                stop
                if arg 1 is "wyrzuc":
                        if arg 2 is set:
                                execute console command "pex user %name of player% add worldguard.*"   
                                execute player command "rg removemember %name of player% %arg 2%"
                                execute player command "pex user %name of player% remove worldguard.*"
                                send "&3&o>> &7Usunales gracza &3%arg 2% &7z terenu!"
                        else:
                                send "&3&o>> &7Podaj nick gracza!"     
                                stop
                if arg 1 is "help":
                        if arg 2 is not set:
                                send "&7&m==============&7[&3CUB&7]&7&m=============="
                                send "&3/cub help &7-pokazuje to menu"
                                send "&3/cub zaloz [ID] &7-zabezpiecza teren"
                                send "&3/cub dodaj [NICK] &7-dodaje gracza"
                                send "&3/cub wyrzuc [NICK] &7-usuwa gracza"
                                send "&3/cub list &7-cennik i wymiary terenów"
                                send "&3/cub usun &7-usuwa zabezpieczenie terenu"
                                send "&3/cub dom &7-teleportuje do domu"
                                send "&7&m================================"
                if arg 1 is "usun":
                        if arg 2 is not set:
                                if {cub.set.%player%} is true:
                                        execute console command "rg remove -w world %name of player%"
                                        send "&3&o>> &7Usunales teren!"
                                        set {cub.set.%player%} to false
                                else:
                                        send "&3&o>> &7Nie masz swojego terenu!"
                if arg 1 is "dom":
                        if arg 2 is not set:
                                if {cub.set.%player%} is true:
                                        set {cubtp.%player%} to true
                                        send "&3&o>> &7Teleportacja za &35 &7sekund!"
                                        set {cubtpl} to location of player
                                        wait 1 second
                                        if {cubtpl} isn't location of player:
                                                send "&3&o>> &7Teleportacja zostala przerwana!"
                                                set {cubtp.%player%} to false
                                                stop
                                        wait 1 second
                                        if {cubtpl} isn't location of player:
                                                send "&3&o>> &7Teleportacja zostala przerwana!"
                                                set {cubtp.%player%} to false
                                                stop
                                        wait 1 second
                                        if {cubtpl} isn't location of player:
                                                send "&3&o>> &7Teleportacja zostala przerwana!"
                                                set {cubtptp.%player%} to false
                                                stop
                                        wait 1 second
                                        if {cubtpl} isn't location of player:
                                                send "&3&o>> &7Teleportacja zostala przerwana!"
                                                set {cubtptp.%player%} to false
                                                stop
                                        wait 1 second
                                        if {cubtpl} isn't location of player:
                                                send "&3&o>> &7Teleportacja zostala przerwana!"
                                                set {cubtptp.%player%} to false
                                                stop
                                        teleport player to {cubdom.%player%}
                                        send "&3&o>> &7Zostales przeteleportowany na swoj teren!"
                                else:
                                        send "&3&o>> &7Nie masz swojego terenu!"
                if arg 1 is not set:
                        if arg 2 is not set:
                                send "&7&m==============&7[&3CUB&7]&7&m=============="
                                send "&3/cub help &7-pokazuje to menu"
                                send "&3/cub zaloz [ID] &7-zabezpiecza teren"
                                send "&3/cub dodaj [NICK] &7-dodaje gracza"
                                send "&3/cub wyrzuc [NICK] &7-usuwa gracza"
                                send "&3/cub list &7-cennik i wymiary terenów"
                                send "&3/cub usun &7-usuwa zabezpieczenie terenu"
                                send "&3/cub dom &7-teleportuje do domu"
                                send "&7&m================================"    
 
on command "cuboid zaloz" or "cub zaloz":
        if {cub.set.%player%} is true:
                cancel event
                send "&3&o>> &7Posiadasz juz swoj teren!"
		
Opublikowano

@ScoreBoard dzięki, ale nadal mam problem z tym, że gracz może zakładać cuboid na cuboidzie innego gracza.

HTBCzoQ.png


Chcesz żebym zobaczył co nabazgrałeś?


dodaj @rzy4y do posta to zobacze :)


if player has name "rzy4y"


Execute command: /Give a like


Opublikowano

@ScoreBoard dzięki, ale nadal mam problem z tym, że gracz może zakładać cuboid na cuboidzie innego gracza.

to sprawdzaj przy zakładaniu czy p can build -> jesli nie moze to jest cuboid czyli cancel event a jak moze budowac/niszczyc to nie ma cuba, prost

Opublikowano

@

332543245

a mógłbyś mi to dopisać do tego skryptu? Ja obeznany w tym nie jestem :)

HTBCzoQ.png


Chcesz żebym zobaczył co nabazgrałeś?


dodaj @rzy4y do posta to zobacze :)


if player has name "rzy4y"


Execute command: /Give a like


Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...