i am trying to make chatcolor but there is some error in the function i have when i am trying to compare a argument passed to the function with text the argument is passed as text
would be nice if anyone can help me ty
Skript: newest 2.3
function Error:
Can't compare "%{_c}% with a text (if %{_c}% is equal to "&a", "&b", "&a", "&c", "&d", "&e", "&f", "&0", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9", "&k", "&l", "&m", "&n" or "&o"
function changecc(c: text, p: player):
replace all "$" with "&" in {_c}
if %{_c}% is equal to "&a", "&b", "&a", "&c", "&d", "&e", "&f", "&0", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9", "&k", "&l", "&m", "&n" or "&o":
set {chatcolor.%{_p}%} to %{_c}%
else if %{_c}% is equal to "&k", "&l", "&m", "&n" or "&o":
set {chatcolor2.%{_p}%} to {_c}
else if {_c} is equal to "&r":
set {chatcolor.%{_p}%} to ""
set {chatcolor2.%{_p}%} to ""
Command no error:
command /chatcolor <text> [<player>]:
aliases: chatc, ccolor, cchat
usage: /chatcolor <color> [<player>]
permission: sk.chatcolor
permission message: &b[&9ChatColor&b] &cYou do not have this permission
trigger:
if arg 2 is not set:
changecc(arg 1, command sender)
else:
changecc(arg 1, arg 2)
would be nice if anyone can help me ty
Skript: newest 2.3
function Error:
Can't compare "%{_c}% with a text (if %{_c}% is equal to "&a", "&b", "&a", "&c", "&d", "&e", "&f", "&0", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9", "&k", "&l", "&m", "&n" or "&o"
function changecc(c: text, p: player):
replace all "$" with "&" in {_c}
if %{_c}% is equal to "&a", "&b", "&a", "&c", "&d", "&e", "&f", "&0", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9", "&k", "&l", "&m", "&n" or "&o":
set {chatcolor.%{_p}%} to %{_c}%
else if %{_c}% is equal to "&k", "&l", "&m", "&n" or "&o":
set {chatcolor2.%{_p}%} to {_c}
else if {_c} is equal to "&r":
set {chatcolor.%{_p}%} to ""
set {chatcolor2.%{_p}%} to ""
Command no error:
command /chatcolor <text> [<player>]:
aliases: chatc, ccolor, cchat
usage: /chatcolor <color> [<player>]
permission: sk.chatcolor
permission message: &b[&9ChatColor&b] &cYou do not have this permission
trigger:
if arg 2 is not set:
changecc(arg 1, command sender)
else:
changecc(arg 1, arg 2)