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

Skrypt mi nie działa, poprawcie go


EricosPL

Rekomendowane odpowiedzi

Opublikowano

on fishing:
    cancel event
    send "x"
    set {czas} to a random integer between 5 and 15
    send "Musisz poczekać dokładnie {czas} sekund"
    wait {czas} seconds
    set {item} to random integer between 1 and 2
    if {item} is 1
    give stone named "&x" to player
    set {item} to random integer between 1 and 2
    if {item} is 2
    give dirt named "y" to player

Opublikowano

XDDDD, to jest rozkaz?

Cytat

nie działa, poprawcie go.

 

Jakies bledy?

Skrypt zle calkiem napisany ;p

 

1. czemu uzywasz zmiennej globalnej zamiast dla jednego gracza? ( masz {czas}, powinno byc np. {czas::%player%} )

2. Zle wytabowany skrypt, zle napisany

Poprawione;

on fishing:
	cancel event
	send "XXX"
	set {czas::%player%} to a random integer between 5 and 15
	send "Musisz poczekać dokładnie %{czas::%player%}% sekund"
	set {_czas} to {czas::%player%}
	wait {_czas} seconds
	set {_item} to random integer between 1 and 2
	if {_item} is 1:
		give stone named "x" to player
		set {item} to random integer between 1 and 2
		stop
	if {item} is 2:
		give dirt named "y" to player
		stop

 

 

 

JAVA <3

 

Opublikowano
	if {_item} is 1:
		give stone named "x" to player
		set {item} to random integer between 1 and 2
		stop
	if {item} is 2:
		give dirt named "y" to player
		stop

wszystko wygląda ok oprócz tego, co to jest raz zmienna tymczasowa raz tab tu raz tam nie rozumiem po prostu

Opublikowano
3 minuty temu, EricosPL napisał:

	if {_item} is 1:
		give stone named "x" to player
		set {item} to random integer between 1 and 2
		stop
	if {item} is 2:
		give dirt named "y" to player
		stop

wszystko wygląda ok oprócz tego, co to jest raz zmienna tymczasowa raz tab tu raz tam nie rozumiem po prostu

Pisane na szybko, zapomnialem pododawac "_" do "zmiennej", popraw sobie, a te taby sa dobrze zrobione, tylko ze to jest przy evencie wiec raczej nie bedzie dzialac za dobrze.

Poprawione:

on fishing:
	cancel event
	send "XXX"
	set {czas::%player%} to a random integer between 5 and 15
	send "Musisz poczekać dokładnie %{czas::%player%}% sekund"
	set {_czas} to {czas::%player%}
	wait {_czas} seconds
	set {_item} to random integer between 1 and 2
	if {_item} is 1:
		give stone named "x" to player
		set {_item} to random integer between 1 and 2
		stop
		if {_item} is 2:
			give dirt named "y" to player
			stop
	if {_item} is 2:
		give dirt named "y" to player
		stop

 

 

 

JAVA <3

 

Opublikowano

[12:45:09] [Server thread/ERROR]: '{_czas} seconds' is not a time span (xxx.sk, line 7: wait {czas::%player%} seconds') 

Co z tym zrobić

Opublikowano
on fishing:
	cancel event
	send "XXX"
	set {czas::%player%} to a random integer between 5 and 15
	send "Musisz poczekać dokładnie %{czas::%player%}% sekund"
	set {_czas} to {czas::%player%}
	loop {_czas} times:
		wait 1 real second
	set {_item} to random integer between 1 and 2
	if {_item} is 1:
		give stone named "x" to player
		set {_item} to random integer between 1 and 2
		if {_item} is 2:
			give dirt named "y" to player
			stop
	if {_item} is 2:
		give dirt named "y" to player
		stop

 

 

 

JAVA <3

 

Opublikowano
19 minut temu, Entify napisał:

on fishing:
	cancel event
	send "XXX"
	set {czas::%player%} to a random integer between 5 and 15
	send "Musisz poczekać dokładnie %{czas::%player%}% sekund"
	set {_czas} to {czas::%player%}
	loop {_czas} times:
		wait 1 real second
	set {_item} to random integer between 1 and 2
	if {_item} is 1:
		give stone named "x" to player
		set {_item} to random integer between 1 and 2
		if {_item} is 2:
			give dirt named "y" to player
			stop
	if {_item} is 2:
		give dirt named "y" to player
		stop

 

Dzięki wielkie, przed poprawieniem wystarczyło czekać sekunde i odrazu dropił item! Masz limit like, można zamknąć temat.

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...