SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.07k stars 368 forks source link

Edit: Variables between "%" do not work correctly (Only console does work.) #2298

Closed Agnax closed 5 years ago

Agnax commented 5 years ago

EDIT:

Ok, what really happens is that the variables between "%" do not work correctly, it only works when they are sent to the console.

Description

In the last update, the "loop all players" does not work properly, and leaves residues of the last loop. It only happens in the loop, if you send the message directly to the console, it does not happen.

Steps to Reproduce

The loop does not need to be in a function for the error to occur.

Example 1:

command /sc [<text>]:
    executable by: players
    trigger:
        if arg is set:
            MandarMsj(player,argument)

function MandarMsj(j:player,m:text):
    loop all players:
        if loop-player has permission "insanitychat.staff":
            send "&6&l%{_j}% &f&l> &e%{_m}%" to loop-player
            play sound "entity.arrow.hit_player" with volume 0.2 with pitch 1.2 at loop-player
    send "&6&l%{_j}% &f&l> &e%{_m}%" to console

Example 2:

command /sc [<text>]:
    executable by: players
    trigger:
        if arg is set:
            loop all players:
                if loop-player has permission "insanitychat.staff":
                    send "&6&l%player% &f&l> &e%arg%" to loop-player
                    play sound "entity.arrow.hit_player" with volume 0.2 with pitch 1.2 at loop-player
            send "&6&l%{_j}% &f&l> &e%{_m}%" to console

Expected Behavior

Errors / Screenshots

GIF: https://gyazo.com/6a6c1402c663968160c144dcd758c3e3 In Game: https://gyazo.com/ec285009753b49d7bc4c6f6a9124fc2e Console: https://gyazo.com/0e95c74cebb92d3383c91d04e0e652dd

Server Information

Additional Context

bensku commented 5 years ago

Duplicate of #2279.