• 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Adrihun

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

code_language.skript:
command /pm [<offline player>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "Wrong usage."
        if arg 1 is set:
            if arg 2 is not set:
                send "Wrong usage."
            if arg 1 is online:
                if arg 2 is set:
                    send "&4To &e%arg 1% &f%arg 2%"
                    send "&4From &e%player% &f%arg 2%" to arg 1
                    play "ORB_PICKUP" to arg-1 at volume 2
            else:
                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_language.skript:
on join:
  set {antiddos::%player%} to player's location
 
on chat:
  if {antiddos::%player%} is set:
    if {antiddos::%player%} is player's location:
      cancel event
      message "&cYou have to move a little more before you can chat."
    else:
      delete {antiddos::*}
     
on script unload:
  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
 
  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."
 
@Adrihun

Antispam
code_language.skript:
on chat:
    if {lastmessage.%uuid of player%} is message:
        cancel the event
        message "&7You can't write the same message."
    else:
        set {lastmessage.%uuid of player%} to message

Antiswear just use both methods:

1)
code_language.skript:
on chat:
    if message contains "word":
        cancel the event
        message "&7Don't swear!"
2)
code_language.skript:
on chat:
    replace all "word" in message with "***"




 
@Adrihun

Antispam
code_language.skript:
on chat:
    if {lastmessage.%uuid of player%} is message:
        cancel the event
        message "&7You can't write the same message."
    else:
        set {lastmessage.%uuid of player%} to message

Antiswear just use both methods:

1)
code_language.skript:
on chat:
    if message contains "word":
        cancel the event
        message "&7Don't swear!"
2)
code_language.skript:
on chat:
    replace all "word" in message with "***"



how do i add it to the /pm script
 
how do i add it to the /pm script

You're welcome.
code_language.skript:
command /pm [<offline player>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "Wrong usage."
        if arg 1 is set:
            if arg 2 is not set:
                send "Wrong usage."
            if arg 1 is online:
                if arg 2 is set:
                    if {lastpm.%uuid of player%} is arg-2:
                        message "&7You can't send the same private message."
                        stop
                    else:
                        set {lastpm.%uuid of player%} to arg-2
                        send "&4To &e%arg 1% &f%arg 2%"
                        send "&4From &e%player% &f%arg 2%" to arg 1
                        play "ORB_PICKUP" to arg-1 at volume 2
            else:
                send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
 
You're welcome.
code_language.skript:
command /pm [<offline player>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "Wrong usage."
        if arg 1 is set:
            if arg 2 is not set:
                send "Wrong usage."
            if arg 1 is online:
                if arg 2 is set:
                    if {lastpm.%uuid of player%} is arg-2:
                        message "&7You can't send the same private message."
                        stop
                    else:
                        set {lastpm.%uuid of player%} to arg-2
                        send "&4To &e%arg 1% &f%arg 2%"
                        send "&4From &e%player% &f%arg 2%" to arg 1
                        play "ORB_PICKUP" to arg-1 at volume 2
            else:
                send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
how to add anti swear? xD
 
can you add it to the script cus i dont know which line to add it to sorry i am noob XD
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.
 
can you add it to the script cus i dont know which line to add it to sorry i am noob XD

Here you go
code_language.skript:
command /pm [<offline player>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "Wrong usage."
        if arg 1 is set:
            if arg 2 is not set:
                send "Wrong usage."
            if arg 1 is online:
                if arg 2 is set:
                    if {lastpm.%uuid of player%} is arg-2:
                        message "&7You can't send the same private message."
                        stop
                    else:
                        if arg-2 contains "word":
                            message "&7Don't swear!"
                            stop
                        else:
                            set {lastpm.%uuid of player%} to arg-2
                            send "&4To &e%arg 1% &f%arg 2%"
                            send "&4From &e%player% &f%arg 2%" to arg 1
                            play "ORB_PICKUP" to arg-1 at volume 2
            else:
                send "&c Sorry but &6%arg-1%&7 is currently &6Offline."
 
Status
Not open for further replies.