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.
[doublepost=1632549148,1632473148][/doublepost]Solved by replacing %{_p}% with %player%
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