Solved Message doesn't re-appear after rejoin.

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

TheWolfiiii

Member
Mar 10, 2020
15
0
1
23
Hello! I'm trying to make a warning script which makes a warning message pop up on your screen when a staff member warns you. What I want is for the message only to go away if you type /clearwarning, even if you rejoin. My issue is that when you get warned, and rejoin, the message doesn't re-appear.
Please help me with my issue.

Please keep in mind that I've very recently gotten back into Skripting so please be kind if my issue is stupid.

Code:
command /warn [<offline player>] [<text>]:
    permission: wd.admin
    permission message: &4&l(!) &cYou don't have permission to execute this command.
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                set {_p} to arg-1
                set {IsBeingWarned.%{_p}%} to true
                set {Warning.%{_p}%.reason} to arg-2
                send title "&4(!) WARNING: &c%{Warning.%{_p}%.reason}%" with subtitle "&cType /Clearwarning to remove this from your screen." to {_p} for 3600 seconds
                send "&4(!) &cYou have Warned &8&l%arg-1% &cfor: &c&l%arg-2%"
            else:
                send "&4(!) &cInvalid args, try /Warn <Player> <Reason>"
        else:
            send "&4(!) &cInvalid args, try /Warn <Player> <Reason>"


on join:
    if {IsBeingWarned.%{_p}%} is true:
        wait 1 second
        send title "&4&l(!) WARNING: &c%{Warning.%{_p}%.reason}%" with subtitle "&cType /Clearwarning to remove this from your screen." to {_p} for 3600 seconds


command /clearwarning:
        trigger:
                reset the title of player
                set {IsBeingWarned.%{_p}%} to false
[doublepost=1632549148,1632473148][/doublepost]Solved by replacing %{_p}% with %player%
 
Status
Not open for further replies.