Jump to content
Sign in to follow this  
KngdomsGG

/report Skript

Recommended Posts

Another Release but smaller now

 

command /report [<player>] [<text>]:
    trigger:
        if arg-2 is not set:
            send "&7Usage: &c/report [player] [reason]" to player
            send "&a&6/report duckbeary fly" to player
        else if arg-1 is not set:
            send "&7Usage: &c/report [player] [reason]" to player
            send "&a&6/report duckbeary fly" to player
        else:
            loop all players:
                if loop-player has permission "skript.reports":
                    send "&c&lREPORT!" to loop-player
                    send "&6%player% &7reported &6%arg-1%" to loop-player
                    send "&7Reason: &6%arg-2%" to loop-player

 

or

https://pastebin.com/raw/SsNLnETC

Make sure to credit me!

Share this post


Link to post
Share on other sites

Instead of looping (which may cause lag) you can use:

send "msg" to all players where [input has the permission "perm"]

  • Like 1

[VIP] 2019

[JR.MOD] 10/29/2019

nerd3.png

ok.png

sure.png

Share this post


Link to post
Share on other sites
1 hour ago, Star said:

Instead of looping (which may cause lag) you can use:

send "msg" to all players where [input has the permission "perm"]

+1


Community Support Lead

Discord: Criticyl#0869
----------------------------------------------------------------------


Minehut Vip - 2018/2019
Received Junior Moderator - April 28th 2019

Promoted to Senior Moderator - July 21st 2019

Share this post


Link to post
Share on other sites

Looking at the source, the 'where' filter loops anyway, it just is not evident to the Skripter. https://github.com/SkriptLang/Skript/blob/ec1e8d88bcd28f65c5a7613f63c0812332072256/src/main/java/ch/njol/skript/expressions/ExprFilter.java#L89-L109

 

So there shouldn't be a difference in performance actually. You have to iterate, a server cannot do multiple operations at once.

Edited by ThatOneTqnk

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...