EvoChestenchpl 8 Opublikowano 13 grudnia 2018 Udostępnij Opublikowano 13 grudnia 2018 function addPoint(player) kod: Chcialbym, aby pod levelupach gracz dostawal punkty Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/ Udostępnij na innych stronach Więcej opcji udostępniania...
0 knugi 794 Opublikowano 16 grudnia 2018 Udostępnij Opublikowano 16 grudnia 2018 W komendzie /exp-give: Spoiler command /exp-give [<text>] [<number>] [<text>] [<text>] [<text>]: usage: /exp-give <gracz> <iloœæ> [-s] [-n] [-c] permission: admin permission message: {@msg-no-perm} executable by: console and player trigger: if arg 1 is not set: send "&f/exp-give &c<gracz> &f<iloœæ> [-s] [-n] [-c]" stop set {_p} to arg 1 parsed as offlineplayer if {lv::%{_p}%} is not set: send "{@msg-not-found}" stop if arg 2 is not set: send "&f/exp-give <gracz> &c<iloœæ> &f[-s] [-n] [-c]" stop if arg 2 > {@max-exp-give-limit}: send "&cPodana iloœæ expa jest zbyt du¿a." stop if arg 2 < -{@max-exp-give-limit}: send "&cPodana iloœæ expa jest zbyt du¿a." stop if {dxppl.%{_p}%} < now: delete {dxppl.%{_p}%} {lv::%{_p}%} < {@max-lvl} set {_arg2} to arg 2 if {@exp-rounding} is true: set {xp::%{_p}%} to round {xp::%{_p}%} set {_arg2} to round up {_arg2} if {expmultiplier} is false: if arg 3 or arg 4 or arg 5 is "-n": set {_x2} to 1 set {_exp} to "{@exp-name}" else: set {_x2} to 1 set {_exp} to "{@exp-name}" if {dxppl.%{_p}%} is set: set {_x2} to {@exp-multiplier-1} set {_exp} to "{@multiplier-1-name}" if {expmultiplier} is true: if arg 3 or arg 4 or arg 5 is "-n": set {_x2} to 1 set {_exp} to "{@exp-name}" else: set {_x2} to {@exp-multiplier-1} set {_exp} to "{@multiplier-1-name}" if {@allow-multiplier-2} is true: if {dxppl.%{_p}%} is set: set {_x2} to {@exp-multiplier-2} set {_exp} to "{@multiplier-2-name}" if {_arg2} < 0: if {@multiplier-negative-exp} is false: set {_x2} to 1 set {_exp} to "{@exp-name}" set {_prexp::%{_p}%} to {xp::%{_p}%} if {xp::%{_p}%} < {mxp::%{_p}%}: add {_arg2}*{_x2} to {xp::%{_p}%} set {_ilosc} to "%{_arg2}*{_x2}%" if {_arg2} > 0: set {_znak} to "{@exp-give-plus}" if {_arg2} <= 0: set {_znak} to "{@exp-give-minus}" if {xp::%{_p}%} < 0: if {@max-negative-exp} <= 0: if {xp::%{_p}%} < {@max-negative-exp}: if {_prexp::%{_p}%} < {@max-negative-exp}: set {xp::%{_p}%} to {_prexp::%{_p}%} else: set {xp::%{_p}%} to {@max-negative-exp} if {xp::%{_p}%} >= {mxp::%{_p}%}: if {@large-exp-mode} is 1: set {_iloscgl.%{_p}%} to {_ilosc}-{mxp::%{_p}%}-{xp::%{_p}%} add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" loop {@max-lvl} times: if {_iloscgl.%{_p}%} >= {mxp::%{_p}%}: set {_iloscgl.%{_p}%} to {_iloscgl.%{_p}%}-{mxp::%{_p}%} add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" if {lv::%{_p}%} >= {@max-lvl}: stop loop if {_iloscgl.%{_p}%} < {mxp::%{_p}%}: set {xp::%{_p}%} to {_iloscgl.%{_p}%} stop loop if {@large-exp-mode} is 2: add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" if {lv::%{_p}%} >= {@max-lvl}: set {xp::%{_p}%} to {mxp::%{_p}%} set {lv::%{_p}%} to {@max-lvl} else: if {@large-exp-mode} is 2: set {xp::%{_p}%} to 0 send "{@msg-lvl-up}" to {_p} addPoint({_p}) if {@lvlup-lighting-effect} is true: strike lightning effect at location of {_p} if {@head-level-enabled} is true: execute console command "/scoreboard players set %{_p}% Levels %{lv::%{_p}%}%" if {@broadcast-lvlup} is true: if {@bc-each-level} is true: set {_bclvlup} to true if {lv::%{_p}%} is {@distinction-levels}: set {_bclvlup} to true if {_bclvlup} is set: loop all players: if {_p} is not loop-player: send "{@msg-lvl-up-bc}" to loop-player if {xp::%{_p}%} is -0: set {xp::%{_p}%} to 0 if executor is player: if player is not {_p}: send "{@msg-exp-other}" if arg 3 or arg 4 or arg 5 is "-c": if executor is console: send "{@msg-exp-other}" if arg 3 or arg 4 or arg 5 is "-s": stop else: send "{@msg-exp}" to {_p} Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201120 Udostępnij na innych stronach Więcej opcji udostępniania...
0 EvoChestenchpl 8 Opublikowano 16 grudnia 2018 Autor Udostępnij Opublikowano 16 grudnia 2018 1 minutę temu, knugi napisał: W komendzie /exp-give: Ukryj zawartość command /exp-give [<text>] [<number>] [<text>] [<text>] [<text>]: usage: /exp-give <gracz> <iloœæ> [-s] [-n] [-c] permission: admin permission message: {@msg-no-perm} executable by: console and player trigger: if arg 1 is not set: send "&f/exp-give &c<gracz> &f<iloœæ> [-s] [-n] [-c]" stop set {_p} to arg 1 parsed as offlineplayer if {lv::%{_p}%} is not set: send "{@msg-not-found}" stop if arg 2 is not set: send "&f/exp-give <gracz> &c<iloœæ> &f[-s] [-n] [-c]" stop if arg 2 > {@max-exp-give-limit}: send "&cPodana iloœæ expa jest zbyt du¿a." stop if arg 2 < -{@max-exp-give-limit}: send "&cPodana iloœæ expa jest zbyt du¿a." stop if {dxppl.%{_p}%} < now: delete {dxppl.%{_p}%} {lv::%{_p}%} < {@max-lvl} set {_arg2} to arg 2 if {@exp-rounding} is true: set {xp::%{_p}%} to round {xp::%{_p}%} set {_arg2} to round up {_arg2} if {expmultiplier} is false: if arg 3 or arg 4 or arg 5 is "-n": set {_x2} to 1 set {_exp} to "{@exp-name}" else: set {_x2} to 1 set {_exp} to "{@exp-name}" if {dxppl.%{_p}%} is set: set {_x2} to {@exp-multiplier-1} set {_exp} to "{@multiplier-1-name}" if {expmultiplier} is true: if arg 3 or arg 4 or arg 5 is "-n": set {_x2} to 1 set {_exp} to "{@exp-name}" else: set {_x2} to {@exp-multiplier-1} set {_exp} to "{@multiplier-1-name}" if {@allow-multiplier-2} is true: if {dxppl.%{_p}%} is set: set {_x2} to {@exp-multiplier-2} set {_exp} to "{@multiplier-2-name}" if {_arg2} < 0: if {@multiplier-negative-exp} is false: set {_x2} to 1 set {_exp} to "{@exp-name}" set {_prexp::%{_p}%} to {xp::%{_p}%} if {xp::%{_p}%} < {mxp::%{_p}%}: add {_arg2}*{_x2} to {xp::%{_p}%} set {_ilosc} to "%{_arg2}*{_x2}%" if {_arg2} > 0: set {_znak} to "{@exp-give-plus}" if {_arg2} <= 0: set {_znak} to "{@exp-give-minus}" if {xp::%{_p}%} < 0: if {@max-negative-exp} <= 0: if {xp::%{_p}%} < {@max-negative-exp}: if {_prexp::%{_p}%} < {@max-negative-exp}: set {xp::%{_p}%} to {_prexp::%{_p}%} else: set {xp::%{_p}%} to {@max-negative-exp} if {xp::%{_p}%} >= {mxp::%{_p}%}: if {@large-exp-mode} is 1: set {_iloscgl.%{_p}%} to {_ilosc}-{mxp::%{_p}%}-{xp::%{_p}%} add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" loop {@max-lvl} times: if {_iloscgl.%{_p}%} >= {mxp::%{_p}%}: set {_iloscgl.%{_p}%} to {_iloscgl.%{_p}%}-{mxp::%{_p}%} add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" if {lv::%{_p}%} >= {@max-lvl}: stop loop if {_iloscgl.%{_p}%} < {mxp::%{_p}%}: set {xp::%{_p}%} to {_iloscgl.%{_p}%} stop loop if {@large-exp-mode} is 2: add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" if {lv::%{_p}%} >= {@max-lvl}: set {xp::%{_p}%} to {mxp::%{_p}%} set {lv::%{_p}%} to {@max-lvl} else: if {@large-exp-mode} is 2: set {xp::%{_p}%} to 0 send "{@msg-lvl-up}" to {_p} addPoint({_p}) if {@lvlup-lighting-effect} is true: strike lightning effect at location of {_p} if {@head-level-enabled} is true: execute console command "/scoreboard players set %{_p}% Levels %{lv::%{_p}%}%" if {@broadcast-lvlup} is true: if {@bc-each-level} is true: set {_bclvlup} to true if {lv::%{_p}%} is {@distinction-levels}: set {_bclvlup} to true if {_bclvlup} is set: loop all players: if {_p} is not loop-player: send "{@msg-lvl-up-bc}" to loop-player if {xp::%{_p}%} is -0: set {xp::%{_p}%} to 0 if executor is player: if player is not {_p}: send "{@msg-exp-other}" if arg 3 or arg 4 or arg 5 is "-c": if executor is console: send "{@msg-exp-other}" if arg 3 or arg 4 or arg 5 is "-s": stop else: send "{@msg-exp}" to {_p} Przetestuję jutro. Chciałbym powiedzieć, że tą komenda exp-give w innym skripcie jest nadawany exp. Nie chciałbym aby okazało się, że za każdym zabiciem moba, czyli wywołaniem komendy exp-give nadawało punkt. Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201121 Udostępnij na innych stronach Więcej opcji udostępniania...
0 knugi 794 Opublikowano 16 grudnia 2018 Udostępnij Opublikowano 16 grudnia 2018 Nie powinno, tylko popraw tam te taby, bo mi się rozjechały podczas edytowania skryptu. Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201122 Udostępnij na innych stronach Więcej opcji udostępniania...
0 EvoChestenchpl 8 Opublikowano 18 grudnia 2018 Autor Udostępnij Opublikowano 18 grudnia 2018 (edytowane) [18:41:20] [Server thread/ERROR]: 'addPoint({_p})' is not a boolean (yes/no) (levele.sk, line 639: addPoint({_p})') [ Moglby ktoś zrobic reset expa po wbiciu lvl teraz jest tak: 700/700 Level UP 700/1400 #### chcialbym, aby bylo tak: 700/700 Level UP 0/1400 Edytowane 18 grudnia 2018 przez EvoChestenchpl Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201215 Udostępnij na innych stronach Więcej opcji udostępniania...
0 knugi 794 Opublikowano 18 grudnia 2018 Udostępnij Opublikowano 18 grudnia 2018 Zapewne nie masz tej funkcji, lub inaczej się nazywa. I również tak gdzie tą linijkę dodaj takie coś: clear {xp::%{_p}%} Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201246 Udostępnij na innych stronach Więcej opcji udostępniania...
0 EvoChestenchpl 8 Opublikowano 19 grudnia 2018 Autor Udostępnij Opublikowano 19 grudnia 2018 A ten error? 9 godzin temu, knugi napisał: Zapewne nie masz tej funkcji, lub inaczej się nazywa. I również tak gdzie tą linijkę dodaj takie coś: clear {xp::%{_p}%} Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201259 Udostępnij na innych stronach Więcej opcji udostępniania...
0 knugi 794 Opublikowano 19 grudnia 2018 Udostępnij Opublikowano 19 grudnia 2018 12 godzin temu, knugi napisał: Zapewne nie masz tej funkcji, lub inaczej się nazywa. Podaj kod z tą funkcją addPoint, która zrobiłeś Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201267 Udostępnij na innych stronach Więcej opcji udostępniania...
0 EvoChestenchpl 8 Opublikowano 21 grudnia 2018 Autor Udostępnij Opublikowano 21 grudnia 2018 (edytowane) W dniu 19.12.2018 o 10:16, knugi napisał: Podaj kod z tą funkcją addPoint, która zrobiłeś command /exp-give [<text>] [<number>] [<text>] [<text>] [<text>]: usage: /exp-give <gracz> <iloœæ> [-s] [-n] [-c] permission: admin permission message: {@msg-no-perm} executable by: console and player trigger: if arg 1 is not set: send "&f/exp-give &c<gracz> &f<iloœæ> [-s] [-n] [-c]" stop set {_p} to arg 1 parsed as offlineplayer if {lv::%{_p}%} is not set: send "{@msg-not-found}" stop if arg 2 is not set: send "&f/exp-give <gracz> &c<iloœæ> &f[-s] [-n] [-c]" stop if arg 2 > {@max-exp-give-limit}: send "&cPodana iloœæ expa jest zbyt du¿a." stop if arg 2 < -{@max-exp-give-limit}: send "&cPodana iloœæ expa jest zbyt du¿a." stop if {dxppl.%{_p}%} < now: delete {dxppl.%{_p}%} {lv::%{_p}%} < {@max-lvl} set {_arg2} to arg 2 if {@exp-rounding} is true: set {xp::%{_p}%} to round {xp::%{_p}%} set {_arg2} to round up {_arg2} if {expmultiplier} is false: if arg 3 or arg 4 or arg 5 is "-n": set {_x2} to 1 set {_exp} to "{@exp-name}" else: set {_x2} to 1 set {_exp} to "{@exp-name}" if {dxppl.%{_p}%} is set: set {_x2} to {@exp-multiplier-1} set {_exp} to "{@multiplier-1-name}" if {expmultiplier} is true: if arg 3 or arg 4 or arg 5 is "-n": set {_x2} to 1 set {_exp} to "{@exp-name}" else: set {_x2} to {@exp-multiplier-1} set {_exp} to "{@multiplier-1-name}" if {@allow-multiplier-2} is true: if {dxppl.%{_p}%} is set: set {_x2} to {@exp-multiplier-2} set {_exp} to "{@multiplier-2-name}" if {_arg2} < 0: if {@multiplier-negative-exp} is false: set {_x2} to 1 set {_exp} to "{@exp-name}" set {_prexp::%{_p}%} to {xp::%{_p}%} if {xp::%{_p}%} < {mxp::%{_p}%}: add {_arg2}*{_x2} to {xp::%{_p}%} set {_ilosc} to "%{_arg2}*{_x2}%" if {_arg2} > 0: set {_znak} to "{@exp-give-plus}" if {_arg2} <= 0: set {_znak} to "{@exp-give-minus}" if {xp::%{_p}%} < 0: if {@max-negative-exp} <= 0: if {xp::%{_p}%} < {@max-negative-exp}: if {_prexp::%{_p}%} < {@max-negative-exp}: set {xp::%{_p}%} to {_prexp::%{_p}%} else: set {xp::%{_p}%} to {@max-negative-exp} if {xp::%{_p}%} >= {mxp::%{_p}%}: if {@large-exp-mode} is 1: set {_iloscgl.%{_p}%} to {_ilosc}-{mxp::%{_p}%}-{xp::%{_p}%} add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" loop {@max-lvl} times: if {_iloscgl.%{_p}%} >= {mxp::%{_p}%}: set {_iloscgl.%{_p}%} to {_iloscgl.%{_p}%}-{mxp::%{_p}%} add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" if {lv::%{_p}%} >= {@max-lvl}: stop loop if {_iloscgl.%{_p}%} < {mxp::%{_p}%}: set {xp::%{_p}%} to {_iloscgl.%{_p}%} stop loop if {@large-exp-mode} is 2: add 1 to {lv::%{_p}%} execute console command "/maxexpchange %{_p}%" if {lv::%{_p}%} >= {@max-lvl}: set {xp::%{_p}%} to {mxp::%{_p}%} set {lv::%{_p}%} to {@max-lvl} else: if {@large-exp-mode} is 2: set {xp::%{_p}%} to 0 send "{@msg-lvl-up}" to {_p} addPoint({_p}) clear {xp::%{_p}%} if {@lvlup-lighting-effect} is true: strike lightning effect at location of {_p} if {@head-level-enabled} is true: execute console command "/scoreboard players set %{_p}% Levels %{lv::%{_p}%}%" if {@broadcast-lvlup} is true: if {@bc-each-level} is true: set {_bclvlup} to true if {lv::%{_p}%} is {@distinction-levels}: set {_bclvlup} to true if {_bclvlup} is set: loop all players: if {_p} is not loop-player: send "{@msg-lvl-up-bc}" to loop-player if {xp::%{_p}%} is -0: set {xp::%{_p}%} to 0 if executor is player: if player is not {_p}: send "{@msg-exp-other}" if arg 3 or arg 4 or arg 5 is "-c": if executor is console: send "{@msg-exp-other}" if arg 3 or arg 4 or arg 5 is "-s": stop else: send "{@msg-exp}" to {_p} Niby clear xp dziala, ale powinno resetowac do 0, a to czysci zmienna i wtedy jest none AddPoint nadal nie dziala ten sam blad @edit Naprawilem set {xp::%{_p}%} to 0 zadzialalo Edytowane 21 grudnia 2018 przez EvoChestenchpl Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201448 Udostępnij na innych stronach Więcej opcji udostępniania...
0 knugi 794 Opublikowano 21 grudnia 2018 Udostępnij Opublikowano 21 grudnia 2018 Z clearem, mój błąd. Bardzo dobrze, że sobie poradziłeś. I nie chodziło mi o komendę exp-give tylko te funkcję. Masz ją w ogóle czy nazwę se z **** wziąłeś? Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201486 Udostępnij na innych stronach Więcej opcji udostępniania...
0 EvoChestenchpl 8 Opublikowano 21 grudnia 2018 Autor Udostępnij Opublikowano 21 grudnia 2018 (edytowane) 32 minuty temu, knugi napisał: Z clearem, mój błąd. Bardzo dobrze, że sobie poradziłeś. I nie chodziło mi o komendę exp-give tylko te funkcję. Masz ją w ogóle czy nazwę se z **** wziąłeś? Aha, no jest podam Ci kod za chwilę @edit Edytowane 21 grudnia 2018 przez EvoChestenchpl Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201489 Udostępnij na innych stronach Więcej opcji udostępniania...
0 knugi 794 Opublikowano 21 grudnia 2018 Udostępnij Opublikowano 21 grudnia 2018 Jest to w innym skrypcie, zmień nazwy skryptów, aby ten skrypt co posiada funkcję addPoint był szybciej ładowany od tego skryptu w temacie. Odnośnik do komentarza https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/#findComment-201495 Udostępnij na innych stronach Więcej opcji udostępniania...
Pytanie
EvoChestenchpl 8
function
addPoint(player)kod:
Chcialbym, aby pod levelupach gracz dostawal punkty
Odnośnik do komentarza
https://skript.pl/temat/30796-gdzie-doda%C4%87-funkcje/Udostępnij na innych stronach
11 odpowiedzi na to pytanie
Rekomendowane odpowiedzi