1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anti Swear to message?

Discussion in 'Skript' started by Adrihun, Mar 12, 2017.

Thread Status:
Not open for further replies.
  1. Adrihun

    Adrihun Member

    Joined:
    Feb 1, 2017
    Messages:
    368
    Likes Received:
    6
    Hey, thanks for clicking on my post.
    Its me aggain "_"
    How do i add Anti Swear, Anti Spam (1 sec) to my script?

    Code (Skript):
    1. command /pm [<offline player>] [<text>]:
    2.     trigger:
    3.         if arg 1 is not set:
    4.             send "Wrong usage."
    5.         if arg 1 is set:
    6.             if arg 2 is not set:
    7.                 send "Wrong usage."
    8.             if arg 1 is online:
    9.                 if arg 2 is set:
    10.                     send "&4To &e%arg 1% &f%arg 2%"
    11.                     send "&4From &e%player% &f%arg 2%" to arg 1
    12.                     play "ORB_PICKUP" to arg-1 at volume 2
    13.             else:
    14.                 send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
    Also i have another script that will say "you have to move to chat" this is because someone threatend me saying i will spambot you.

    Code (Skript):
    1. on join:
    2.   set {antiddos::%player%} to player's location
    3.  
    4. on chat:
    5.   if {antiddos::%player%} is set:
    6.     if {antiddos::%player%} is player's location:
    7.       cancel event
    8.       message "&cYou have to move a little more before you can chat."
    9.     else:
    10.       delete {antiddos::*}
    11.      
    12. on script unload:
    13.   delete {antiddos::*}
    I TRIED adding these scripts to my message script but it gave me some errors.

    please if you know script, help me out and fix my stupid script xD
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    1. i dont sure if that what you mean but if it is enjoy
    2. just dont copy and paste it in your skript folder it will give you space error {write what i add in your self}

    3. command /pm [<offline player>] [<text>]:
    4. trigger:
    5. if {antispam} is false: # check if anti spam is false if it true it will sand you "&6[AntiSpam] &f Dont Spam"
    6. if arg 1 is not set:
    7. send "Wrong usage."
    8. if arg 1 is set:
    9. if arg 2 is not set:
    10. send "Wrong usage."
    11. if arg 1 is online:
    12. if arg 2 is set:
    13. send "&4To &e%arg 1% &f%arg 2%"
    14. send "&4From &e%player% &f%arg 2%" to arg 1
    15. play "ORB_PICKUP" to arg-1 at volume 2
    16. set {antispam} to "true" # it will set you anti spam to true
    17. wait 1 seconds
    18. set {antispam} to "false" # when anti spam is false you will be able to use that command again
    19. else:
    20. message "&6[AntiSpam] &f Dont Spam" # active when anti spam is true
    21. else:
    22. send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    @Adrihun

    Antispam
    Code (Skript):
    1. on chat:
    2.     if {lastmessage.%uuid of player%} is message:
    3.         cancel the event
    4.         message "&7You can't write the same message."
    5.     else:
    6.         set {lastmessage.%uuid of player%} to message
    Antiswear just use both methods:

    1)
    Code (Skript):
    1. on chat:
    2.     if message contains "word":
    3.         cancel the event
    4.         message "&7Don't swear!"
    2)
    Code (Skript):
    1. on chat:
    2.     replace all "word" in message with "***"



     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    how do i add it to the /pm script
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    You're welcome.
    Code (Skript):
    1. command /pm [<offline player>] [<text>]:
    2.     trigger:
    3.         if arg 1 is not set:
    4.             send "Wrong usage."
    5.         if arg 1 is set:
    6.             if arg 2 is not set:
    7.                 send "Wrong usage."
    8.             if arg 1 is online:
    9.                 if arg 2 is set:
    10.                     if {lastpm.%uuid of player%} is arg-2:
    11.                         message "&7You can't send the same private message."
    12.                         stop
    13.                     else:
    14.                         set {lastpm.%uuid of player%} to arg-2
    15.                         send "&4To &e%arg 1% &f%arg 2%"
    16.                         send "&4From &e%player% &f%arg 2%" to arg 1
    17.                         play "ORB_PICKUP" to arg-1 at volume 2
    18.             else:
    19.                 send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    how to add anti swear? xD
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    Just add
    Code (Skript):
    1. if arg-1 contains "word":
    2.     message "&7You can't write that."
    3.     stop
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    can you add it to the script cus i dont know which line to add it to sorry i am noob XD
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    so you just spam every problem without attempting to fix it yourself, hence the 103 messages/0 likes and ask for help? the way you learn is by attempting and learning, not being fed your answers.
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    Here you go
    Code (Skript):
    1. command /pm [<offline player>] [<text>]:
    2.     trigger:
    3.         if arg 1 is not set:
    4.             send "Wrong usage."
    5.         if arg 1 is set:
    6.             if arg 2 is not set:
    7.                 send "Wrong usage."
    8.             if arg 1 is online:
    9.                 if arg 2 is set:
    10.                     if {lastpm.%uuid of player%} is arg-2:
    11.                         message "&7You can't send the same private message."
    12.                         stop
    13.                     else:
    14.                         if arg-2 contains "word":
    15.                             message "&7Don't swear!"
    16.                             stop
    17.                         else:
    18.                             set {lastpm.%uuid of player%} to arg-2
    19.                             send "&4To &e%arg 1% &f%arg 2%"
    20.                             send "&4From &e%player% &f%arg 2%" to arg 1
    21.                             play "ORB_PICKUP" to arg-1 at volume 2
    22.             else:
    23.                 send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
     
Thread Status:
Not open for further replies.

Share This Page

Loading...