- Joined
- Jun 7, 2008
- Messages
- 440
I have the following custom script:
I was wondering how i would use this for when a random player triggers an event?
JASS:
function PlayerColouredText takes player p, string txt returns string
local playercolor pc = GetPlayerColor(p)
if pc == PLAYER_COLOR_RED then
set txt = "|cffFF0202"+txt+"|r"
elseif pc == PLAYER_COLOR_BLUE then
set txt = "|cff0041FF"+txt+"|r"
elseif pc == PLAYER_COLOR_CYAN then
set txt = "|Cff1BE5B8"+txt+"|r"
elseif pc == PLAYER_COLOR_PURPLE then
set txt = "|CFF530080"+txt+"|r"
elseif pc == PLAYER_COLOR_YELLOW then
set txt = "|CFFFFFC00"+txt+"|r"
elseif pc == PLAYER_COLOR_ORANGE then
set txt = "|CFFFE890D"+txt+"|r"
elseif pc == PLAYER_COLOR_GREEN then
set txt = "|CFF1FBF00"+txt+"|r"
elseif pc == PLAYER_COLOR_PINK then
set txt = "|CFFE45AAF"+txt+"|r"
elseif pc == PLAYER_COLOR_LIGHT_GRAY then
set txt = "|CFF949596"+txt+"|r"
elseif pc == PLAYER_COLOR_LIGHT_BLUE then
set txt = "|CFF7DBEF1"+txt+"|r"
elseif pc == PLAYER_COLOR_AQUA then
set txt = "|CFF0F6145"+txt+"|r"
elseif pc == PLAYER_COLOR_BROWN then
set txt = "|CFF4D2903"+txt+"|r"
else // A safty function
set txt = "|CFFFFFFFF"+txt+"|r"
endif
set pc = null
return txt
endfunction
I was wondering how i would use this for when a random player triggers an event?