Solved Command to show other admins someone is using worldedit

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Searis

Member
Jul 9, 2023
2
0
1
23
I saw this on another server it showed when someone used worldedit but it only sent the message to admins and showed what action they did: set, wall and so on any way to replicate that in skript?
 
sure! Here is a worldeditlogger skript, but CoreProtect also has this.



code_language.skript:
On command:
    if the command contains "/":
        loop all players:
            if loop-player has permission "skript.wea":
                send "&c&lADMIN &6➲ %player% is using worldedit! /%full command%" to loop-player

HOW IT WORKS: Due to skript (when checking commands) ignoring the first /, we can see if the command contains "/", which would mean "//x" or "/x/" would trigger the alert.

A better solution would be
code_language.skript:
On command:
    if the command contains "/":
        if player has permission "worldedit.use":
            loop all players:
                if loop-player has permission "skript.wea":
                    send "&c&lADMIN &6➲ %player% is using worldedit! /%full command%" to loop-player
        else:
            send "&c&lSECURITY &6➲ Account %player% does not have the permission worldedit.use so you can not use worldedit commands :c"
            cancel event

What this new thing does is only lets plrs with "worldedit.use" use world-edit commands, and any1 else who doesn't cant use them (this also wont send an alert to admins)