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

[Problem] Napisanie Skryptu


Rekomendowane odpowiedzi

Opublikowano

Witajcie.

Ostatnio (czyli dzisiaj xD) wziąłem się za pisanie skryptów. Jak narazie działają, ale teraz już coś innego i po prostu nie ogarniam.

on rightclick on a sponge:
	player has permissions "wyjscie.niespodzianka"
		message "&bWyszedles z domu"
		tp player 571 124 -322

I tu mam problem, a w sumie kilka :

1. Czy poprawnie jest całość napisana (To jest całość w pliku .sk) ?

2. Czy takie coś będzie działać ?

3. Czy jeżeli jest źle, ktoś postara się poprawić i mi pomóc uczyć się pisania Skryptów ?

Opublikowano

Moim zdaniem powinno być tak:

on rightclick on a sponge:
	if player has permissions "wyjscie.niespodzianka":
		message "&bWyszedles z domu"
		teleport the player to (571, 124, -322)
Opublikowano

on rightclick on a sponge:

if player has permissions "wyjscie.niespodzianka":

message "&bWyszedles z domu"

teleport player to {punkt}

command /ustaw:

aliases: /ust

trigger:

set {punkt} to location of player

send "Ustawiono wyjscie"

 

Napisałem ci prosty skrypt na tp. Pierw ustaw na tych kordach punkt komenda /ustaw po czym jak gracz kliknie na gabke to go tepnie

Pastebin : http://pastebin.com/K6WcLWYF

Opublikowano

Spoko, poradniku nie zrobię ponieważ nie chce mi się, a sam się jeszcze ucze :). Polecam ci w Tutoriale poszukać Kacki i TheBest oni fajnie opisują ;).

Opublikowano

Mam Kolejny Problem :

on rightclick with sugar:
	player has permission "kokaina.uzywki":
		set {czas} to difference between {opoznienie.%player%} and now
		if {czas} is less than 30 seconds:
			send "Jestes Zcpany!Poczekaj %difference between 30 seconds and {czas}%"
		else:
			send "<yellow><bold>BOOST!"
			execute command "/playsound random.fizz %name of player%"
			apply slowness 2 to the player for 60 seconds
			apply jump boost 2 to the player for 20 seconds
			set {opoznienie.%player%} to now

on rightclick with cactus green:
	player has permission "marysia.uzywki":
		set {czas} to difference between {opoznienie.%player%} and now
		if {czas} is less than 30 seconds:
			send "Jestes Zjarany! Poczekaj %difference between 30 seconds and {czas}%"
else:
			send "<green><bold>ALE FAZA!"
			execute command "/playsound mob.zombie.death %name of player%"
			apply speed 3 to the player for 15 seconds
			apply jumpboost 1 to the player for the 20 seconds
			apply confusion 1 to the player for the 30 seconds
			apply hunger 1 to the player for the 30 seconds
			set {opoznienie.%player%} to now

on rightclick with dead bush:
	player has permission "joint.uzywki":
		set {czas} to difference between {opoznienie.%player} and now
		if {czas} is less than 30 seconds:
			send "Jestes Zjarany! Poczekaj %difference between 30 seconds and {czas}%"
else:
			send "<brown><bold>Oh My Godness!"
			execute command "/playsound random.burp %name of player%"
			apply slowness 2 to the player for 30 seconds
			apply increase_damage 1 to the player for 10 seconds
			apply blindness 1 to the player for 5 seconds
			set {opoznienie.%player%} to now

Teraz, czy da ktoś naprawić ? Bo wg tego co pokazuje serwer i tak nie ogarniam xD

Opublikowano

W tym kodzie zrobiłeś trochę literówek. Jak chcesz pisać poprawnie to czytaj to co ci konsola wyrzuci, bo inaczej twoje skrypty będą miały masę błędów.

 

Tu masz kod (teoretycznie powinien działać :D)

on rightclick with sugar:
	if player has permission "kokaina.uzywki":
		set {czas} to difference between {opoznienie.%player%} and now
		if {czas} is less than 30 seconds:
			send "Jestes Zcpany!Poczekaj %difference between 30 seconds and {czas}%"
		else:
			send "<yellow><bold>BOOST!"
			execute command "/playsound random.fizz %name of player%"
			apply slowness 2 to the player for 60 seconds
			apply jump boost 2 to the player for 20 seconds
			set {opoznienie.%player%} to now

on rightclick with cactus green:
	if player has permission "marysia.uzywki":
		set {czas} to difference between {opoznienie.%player%} and now
		if {czas} is less than 30 seconds:
			send "Jestes Zjarany! Poczekaj %difference between 30 seconds and {czas}%"
		else:
			send "<green><bold>ALE FAZA!"
			execute command "/playsound mob.zombie.death %name of player%"
			apply speed 3 to the player for 15 seconds
			apply jump boost 1 to the player for 20 seconds
			apply confusion 1 to the player for 30 seconds
			apply hunger 1 to the player for 30 seconds
			set {opoznienie.%player%} to now

on rightclick with dead bush:
	if player has permission "joint.uzywki":
		set {czas} to difference between {opoznienie.%player%} and now
		if {czas} is less than 30 seconds:
			send "Jestes Zjarany! Poczekaj %difference between 30 seconds and {czas}%"
		else:
			send "<brown><bold>Oh My Godness!"
			execute command "/playsound random.burp %name of player%"
			apply slowness 2 to the player for 30 seconds
			apply increase damage 1 to the player for 10 seconds
			apply blindness 1 to the player for 5 seconds
			set {opoznienie.%player%} to now

Jesli pomoglem daj Like.

Opublikowano

@Refresh

I Kolejny Problem. Napisałem na serwer z modami skrypt pod komendę, która oczywiście nie działa.

Oto cały kod :

variables:
	{wigilia.%player%} = false

command /wigilia
	permission: paczka.pixelowy
	trigger:
		if {wigilia.%player%} is true:
			message "&bDostales juz swoja paczke wigilijna!"
		if {wigilia.%player%} is false:
			message "&cOtrzymujesz swoja swiateczna paczke wigilijna!"
			execute command "/playsound fireworks.launch %name of player%"
			execute command "/give %name of player% 5325 64"
			execute command "/give %name of player% 16090 16"
			execute command "/give %name of player% 15276 1"
			execute command "/give %name of player% 15298 12"
			execute command "/give %name of player% 15286 8"
			execute command "/give %name of player% 15307 6"
			execute command "/give %name of player% 5330 4"
			execute command "/give %name of player% 15310 12"
			execute command "/give %name of player% 296 1"
			execute command "/give %name of player% 15761 4"
			execute command "/give %name of player% 5425 2"
			execute command "/give %name of player% 15317 4"
			execute command "/give %name of player% 16063 2"
			execute command "/give %name of player% 350 3"
			execute command "/give %name of player% 15985 6"
			execute command "/give %name of player% 5383 4"
			execute command "/give %name of player% 16209 16"
			execute command "/give %name of player% 16221 16"
			execute command "/give %name of player% 5336 4"
			execute command "/give %name of player% 16165 2"
			execute command "/give %name of player% 15515 6"
			execute command "/give %name of player% 16320 1"
			execute command "/give %name of player% 16162 32"

Starałem się stosować do tego, co mówił serwer, ale i tak lipton.

Opublikowano
variables:
	{wigilia.%player%} = false
command /wigilia:
	permission: paczka.pixelowy
	trigger:
            if {wigilia.%player%} is true:
                message "&bDostales juz swoja paczke wigilijna!"
            if {wigilia.%player%} is false:
                message "&cOtrzymujesz swoja swiateczna paczke wigilijna!"
                execute console command command "/playsound fireworks.launch %player%"
                execute command "/give %player% 5325 64"
                execute command "/give %name of player% 16090 16"
                execute command "/give %name of player% 15276 1"
                execute command "/give %name of player% 15298 12"
                execute command "/give %name of player% 15286 8"
                execute command "/give %name of player% 15307 6"
                execute command "/give %name of player% 5330 4"
                execute command "/give %name of player% 15310 12"
                execute command "/give %name of player% 296 1"
                execute command "/give %name of player% 15761 4"
                execute command "/give %name of player% 5425 2"
                execute command "/give %name of player% 15317 4"
                execute command "/give %name of player% 16063 2"
                execute command "/give %name of player% 350 3"
                execute command "/give %name of player% 15985 6"
                execute command "/give %name of player% 5383 4"
                execute command "/give %name of player% 16209 16"
                execute command "/give %name of player% 16221 16"
                execute command "/give %name of player% 5336 4"
                execute command "/give %name of player% 16165 2"
                execute command "/give %name of player% 15515 6"
                execute command "/give %name of player% 16320 1"
                execute command "/give %name of player% 16162 32"

Łap. :)

 

sygnatura.png

Opublikowano

Mi się wydaje, że jeśli dajesz takie coś w variables:

{wigilia.%player%} = false

To stworzy zminną tylko na starcie skryptu, i tylko dla 1 gracza. Mogę się mylić ale spróbuj coś takiego:

on login:
        if {wigilia.%player%} is true:
                stop
        else:
                set {wigilia.%player%} to false

command /wigilia:
        permission: paczka.pixelowy
        trigger:
                if {wigilia.%player%} is true:
                        stop
                else:
                        set {wigilia.%player%} to true
                        .
                        .Tutaj te twoje linijki na dawanie itemów
                        .
                        stop

Jak nie zadziała to zawsze możesz to zrobić na zasadzie permissions.

Jesli pomoglem daj Like.

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...