dimsongopl 0 Opublikowano 31 lipca 2024 Udostępnij Opublikowano 31 lipca 2024 Chciałbym skrypt na 3 bilety do metra: Jednorazowe za 5$ 15 minutowe za 10$ 45 minutowe za 35$ i żeby jak sie nie mialo tych biletów to nie dało się wejść do żadnych wagoników Do kupienia biletów chciałbym komende /metro i tam bedzie gui z tymi 3 biletami Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/ Udostępnij na innych stronach Więcej opcji udostępniania...
0 Saanjuk 50 Opublikowano 1 sierpnia 2024 Udostępnij Opublikowano 1 sierpnia 2024 NIe testowane bo zabrakło czasu: Options: jednorazowy: paper named "&2Bilet jednorazowy" with lore "" and "&bBilet upoważnia do" and "&2jednorazowego" and "&bprzejazdu metrem!" 15_min: paper named "&aBilet 15 minutowy" with lore "" and "&bBilet upoważnia do" and "&a15 minutowego" and "&bporuszania się metrem!" 45_min: paper named "&dBilet 45 minutowy" with lore "" and "&bBilet upoważnia do" and "&d45 minutowego" and "&bporuszania się metrem!" nazwa_gui: "KASA METRA" function metro(p:player): set {_gui} to chest inventory with 1 row named {@nazwa_gui} set slot (integers between 0 and 8) of {_gui} to light gray stained glass pane named "&7" set slot 0 of {_gui} to sunflower named "&eStan konta:" with lore "" and "&b%{_p}'s balance%" set {_lore::*} to lore of {@jednorazowy} set slot 2 of {_gui} to {@jednorazowy} with lore {_lore::*} and "&fCena:&e 5$" and "&eKliknij, aby kupić!" set {_lore::*} to lore of {@15_min} set slot 4 of {_gui} to {@15_min} with lore {_lore::*} and "&fCena:&e 10$" and "&eKliknij, aby kupić!" set {_lore::*} to lore of {@45_min} set slot 6 of {_gui} to {@45_min} with lore {_lore::*} and "&fCena:&e 35$" and "&eKliknij, aby kupić!" set slot 8 of {_gui} to barrier named "&dWyjście" with lore "" and "&eKliknij, aby wyjść!" open {_gui} to {_p} function modular(x:number, y: number)::text: set {_mod} to mod({_x}, {_y}) if {_mod} is set: if {_mod} > 0: set {_minutes} to floor({_x} / {_y}) set {seconds} to {_mod} set {_time} to "%{_minutes}%m %{seconds}%s" return {_time} else: set {_minutes} to floor({_x} / {_y}) set {_time} to "%{_minutes}%m" return {_time} command /metro: trigger: metro(player) on vehicle enter: player's vehicle is a minecart if player has {@jednorazowy}: send "Zużyłes bilet jednorazowy! Miłaj podróży!" to player remove {@jednorazowy} from player's inventory else if {bilet.%player's name%.czas} is 0: if player has {@15_min}: remove {@15_min} from player's inventory set {bilet.%player's name%.czas} to 900 else if player has {@45_min}: remove {@45_min} from player's inventory set {bilet.%player's name%.czas} to 2700 else if {bilet.%player's name%.czas} > 0: send "Użyłeś bilet'u! Czas pozostały na bilecie: %modular({bilet.%player's name%.czas}, 60)%.Miłaj podróży!" to player while player is riding minecart: wait 1 seconds remove 1 from {bilet.%player's name%.czas} if {bilet.%player's name%.czas} is 60: send "&cUWAGA! Czas pozostały na bilecie to mniej niż 60s" to player else: cancel event send "&cNIe posiadasz biletu!" to player on vehicle exit: if {bilet.%player's name%.czas} > 0 seconds: send "Czas pozostały na bilecie: %modular({bilet.%player's name%.czas}, 60)%s" to player on inventory click: if name of event-inventory is {@nazwa_gui}: cancel event if slot is "2": remove 5 from the player's balance give {@jednorazowy} to player if slot is "4": remove 10 from the player's balance give {@15_min} to player if slot is "6": remove 35 from the player's balance give {@45_min} to player on join: if {bilet.%player's name%.czas} is not set: set {bilet.%player's name%.czas} to 0 Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344392 Udostępnij na innych stronach Więcej opcji udostępniania...
0 dimsongopl 0 Opublikowano 1 sierpnia 2024 Autor Udostępnij Opublikowano 1 sierpnia 2024 Nie mogę zakupić biletu klikam i nic sie nie dzieje. Nie moge wyjsc z gui i moge wejsc do wagonikow nawet na randze default bez biletu bez opa. Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344399 Udostępnij na innych stronach Więcej opcji udostępniania...
0 Saanjuk 50 Opublikowano 1 sierpnia 2024 Udostępnij Opublikowano 1 sierpnia 2024 (edytowane) wybacz.. tym razem kod jest przetestowany i sprawny w 100%: Options: bilet_item: paper jednorazowy_nazwa: "&2Bilet jednorazowy" 15_min_nazwa: "&aBilet 15 minutowy" 45_min_nazwa: "&dBilet 45 minutowy" jednorazowy_lore: "" and "&bBilet upoważnia do" and "&2jednorazowego" and "&bprzejazdu metrem!" 15_min_lore: "" and "&bBilet upoważnia do" and "&a15 minutowego" and "&bporuszania się metrem!" 45_min_lore: "" and "&bBilet upoważnia do" and "&d45 minutowego" and "&bporuszania się metrem!" nazwa_gui: "KASA METRA" function metro(p:player): set {_gui} to chest inventory with 1 row named {@nazwa_gui} set slot (integers between 0 and 8) of {_gui} to light gray stained glass pane named "&7" set slot 0 of {_gui} to sunflower named "&eStan konta:" with lore "" and "&b%{_p}'s balance%" set slot 2 of {_gui} to {@bilet_item} named {@jednorazowy_nazwa} with lore {@jednorazowy_lore} and "&fCena:&e 5$" and "&eKliknij, aby kupić!" set slot 4 of {_gui} to {@bilet_item} named {@15_min_nazwa} with lore {@15_min_lore} and "&fCena:&e 10$" and "&eKliknij, aby kupić!" set slot 6 of {_gui} to {@bilet_item} named {@45_min_nazwa} with lore {@45_min_lore} and "&fCena:&e 35$" and "&eKliknij, aby kupić!" set slot 8 of {_gui} to barrier named "&dWyjście" with lore "" and "&eKliknij, aby wyjść!" open {_gui} to {_p} function modular(x:number, y: number)::text: set {_mod} to mod({_x}, {_y}) if {_mod} is set: if {_mod} > 0: set {_minutes} to floor({_x} / {_y}) set {seconds} to {_mod} set {_time} to "%{_minutes}%m %{seconds}%s" return {_time} else: set {_minutes} to floor({_x} / {_y}) set {_time} to "%{_minutes}%m" return {_time} command /metro: trigger: metro(player) on vehicle enter: player's vehicle is a regular minecart if {bilet.%player's name%.czas} > 0: send "Użyłeś bilet'u! Czas pozostały na bilecie: %modular({bilet.%player's name%.czas}, 60)%.Miłaj podróży!" to player while player is riding minecart: wait 1 seconds remove 1 from {bilet.%player's name%.czas} if {bilet.%player's name%.czas} is 60: send "&cUWAGA! Czas pozostały na bilecie to mniej niż 60s" to player else if player has {@bilet_item} named {@jednorazowy_nazwa}: send "Zużyłes bilet jednorazowy! Miłaj podróży!" to player remove {@bilet_item} named {@jednorazowy_nazwa} from player else if {bilet.%player's name%.czas} is 0: if player has {@bilet_item} named {@15_min_nazwa}: remove {@bilet_item} named {@15_min_nazwa} from player set {bilet.%player's name%.czas} to 900 else if player has {@bilet_item} named {@45_min_nazwa}: remove {@bilet_item} named {@45_min_nazwa} from player set {bilet.%player's name%.czas} to 2700 else: cancel event send "&cNie posiadasz biletu! (&e/metro&c)" to player else: cancel event send "&cNie posiadasz biletu! (&e/metro&c)" to player on vehicle exit: if {bilet.%player's name%.czas} > 0 seconds: send "Czas pozostały na bilecie: %modular({bilet.%player's name%.czas}, 60)%s" to player on inventory click: if name of event-inventory is {@nazwa_gui}: cancel event if clicked slot is 2: remove 5 from the player's balance give {@bilet_item} named {@jednorazowy_nazwa} with lore {@jednorazowy_lore} to player if clicked slot is 4: remove 10 from the player's balance give {@bilet_item} named {@15_min_nazwa} with lore {@15_min_lore} to player if clicked slot is 6: remove 35 from the player's balance give {@bilet_item} named {@45_min_nazwa} with lore {@45_min_lore} to player if clicked slot is 8: close player's inventory on join: if {bilet.%player's name%.czas} is not set: set {bilet.%player's name%.czas} to 0 Edytowane 1 sierpnia 2024 przez Saanjuk dimsongopl 1 Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344413 Udostępnij na innych stronach Więcej opcji udostępniania...
0 dimsongopl 0 Opublikowano 1 sierpnia 2024 Autor Udostępnij Opublikowano 1 sierpnia 2024 Dzięki koleżko. Miłego Dnia Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344421 Udostępnij na innych stronach Więcej opcji udostępniania...
0 Saanjuk 50 Opublikowano 1 sierpnia 2024 Udostępnij Opublikowano 1 sierpnia 2024 (edytowane) ważny szczegół: w tej wersji czas liczony jest tylko gdy gracz siedzi w wagoniku nie wiem czy taki był zamysł? Edytowane 1 sierpnia 2024 przez Saanjuk Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344423 Udostępnij na innych stronach Więcej opcji udostępniania...
0 dimsongopl 0 Opublikowano 1 sierpnia 2024 Autor Udostępnij Opublikowano 1 sierpnia 2024 Nie byl taki zamysl ale dobra Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344424 Udostępnij na innych stronach Więcej opcji udostępniania...
0 Saanjuk 50 Opublikowano 1 sierpnia 2024 Udostępnij Opublikowano 1 sierpnia 2024 (edytowane) to tym lepiej bo teraz się zorientowałem że coś nie bardzo chce to odliczać gdy się jedzie... prosze o to wersja kodu w której czas rozpoczyna się w momencie gdy gracz wsiada do wagonika używając biletu i liczony jest cały czas: Options: bilet_item: paper jednorazowy_nazwa: "&2Bilet jednorazowy" 15_min_nazwa: "&aBilet 15 minutowy" 45_min_nazwa: "&dBilet 45 minutowy" jednorazowy_lore: "" and "&bBilet upoważnia do" and "&2jednorazowego" and "&bprzejazdu metrem!" 15_min_lore: "" and "&bBilet upoważnia do" and "&a15 minutowego" and "&bporuszania się metrem!" 45_min_lore: "" and "&bBilet upoważnia do" and "&d45 minutowego" and "&bporuszania się metrem!" nazwa_gui: "KASA METRA" function metro(p:player): set {_gui} to chest inventory with 1 row named {@nazwa_gui} set slot (integers between 0 and 8) of {_gui} to light gray stained glass pane named "&7" set slot 0 of {_gui} to sunflower named "&eStan konta:" with lore "" and "&b%{_p}'s balance%" set slot 2 of {_gui} to {@bilet_item} named {@jednorazowy_nazwa} with lore {@jednorazowy_lore} and "&fCena:&e 5$" and "&eKliknij, aby kupić!" set slot 4 of {_gui} to {@bilet_item} named {@15_min_nazwa} with lore {@15_min_lore} and "&fCena:&e 10$" and "&eKliknij, aby kupić!" set slot 6 of {_gui} to {@bilet_item} named {@45_min_nazwa} with lore {@45_min_lore} and "&fCena:&e 35$" and "&eKliknij, aby kupić!" set slot 8 of {_gui} to barrier named "&dWyjście" with lore "" and "&eKliknij, aby wyjść!" open {_gui} to {_p} function modular(x:number, y: number)::text: set {_mod} to mod({_x}, {_y}) if {_mod} is set: if {_mod} > 0: set {_minutes} to floor({_x} / {_y}) set {seconds} to {_mod} set {_time} to "%{_minutes}%m %{seconds}%s" return {_time} else: set {_minutes} to floor({_x} / {_y}) set {_time} to "%{_minutes}%m" return {_time} command /metro: trigger: metro(player) on vehicle enter: player's vehicle is a regular minecart if {bilet.%player's name%.czas} > 0: send "Użyłeś bilet'u! Czas pozostały na bilecie: %modular({bilet.%player's name%.czas}, 60)%.Miłaj podróży!" to player else if player has {@bilet_item} named {@jednorazowy_nazwa}: send "Zużyłes bilet jednorazowy! Miłaj podróży!" to player remove {@bilet_item} named {@jednorazowy_nazwa} from player else if {bilet.%player's name%.czas} is 0: if player has {@bilet_item} named {@15_min_nazwa}: remove {@bilet_item} named {@15_min_nazwa} from player set {bilet.%player's name%.czas} to 900 else if player has {@bilet_item} named {@45_min_nazwa}: remove {@bilet_item} named {@45_min_nazwa} from player set {bilet.%player's name%.czas} to 2700 else: cancel event send "&cNie posiadasz biletu! (&e/metro&c)" to player else: cancel event send "&cNie posiadasz biletu! (&e/metro&c)" to player on vehicle exit: if {bilet.%player's name%.czas} > 0 seconds: send "Czas pozostały na bilecie: %modular({bilet.%player's name%.czas}, 60)%s" to player on inventory click: if name of event-inventory is {@nazwa_gui}: cancel event if clicked slot is 2: remove 5 from the player's balance give {@bilet_item} named {@jednorazowy_nazwa} with lore {@jednorazowy_lore} to player if clicked slot is 4: remove 10 from the player's balance give {@bilet_item} named {@15_min_nazwa} with lore {@15_min_lore} to player if clicked slot is 6: remove 35 from the player's balance give {@bilet_item} named {@45_min_nazwa} with lore {@45_min_lore} to player if clicked slot is 8: close player's inventory on join: if {bilet.%player's name%.czas} is not set: set {bilet.%player's name%.czas} to 0 while {bilet.%player's name%.czas} > 0: wait 1 seconds set {bilet.%player's name%.czas} to ({bilet.%player's name%.czas} -1) Edytowane 1 sierpnia 2024 przez Saanjuk Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344425 Udostępnij na innych stronach Więcej opcji udostępniania...
0 dimsongopl 0 Opublikowano 2 sierpnia 2024 Autor Udostępnij Opublikowano 2 sierpnia 2024 Ja już nie wiem bo z biletem jednorazowym wszystko śmiga mogę wejść a z czasowymi nie mogę wejść pisze Nie posiadasz biletu /metro . Nie wiem czy bedzie Ci sie chcialo to poprawiać. Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344444 Udostępnij na innych stronach Więcej opcji udostępniania...
0 dimsongopl 0 Opublikowano 4 sierpnia 2024 Autor Udostępnij Opublikowano 4 sierpnia 2024 A i jeszcze jak masz 0$ możesz i tak kupić Cytuj Odnośnik do komentarza https://skript.pl/temat/57983-bilet-do-metra/#findComment-344514 Udostępnij na innych stronach Więcej opcji udostępniania...
Pytanie
dimsongopl 0
Chciałbym skrypt na 3 bilety do metra:
Jednorazowe za 5$
15 minutowe za 10$
45 minutowe za 35$
i żeby jak sie nie mialo tych biletów to nie dało się wejść do żadnych wagoników
Do kupienia biletów chciałbym komende /metro i tam bedzie gui z tymi 3 biletami
Odnośnik do komentarza
https://skript.pl/temat/57983-bilet-do-metra/Udostępnij na innych stronach
9 odpowiedzi na to pytanie
Rekomendowane odpowiedzi
Dołącz do dyskusji
Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.