Hi, I'm trying to make a skript where i can put a url in the chat and it can be clicked.
This is the code i have so far:
at the moment, this code can only do links of 10 characters after the "https://"
does anyone know how i can make this code work with links of any length
This is the code i have so far:
Code:
function link(text:text) :: text:
return {_text}.replaceAll("(https://[a-zA-Z0-9./]{10})", "<link:$1><##84E9FF>&n$1&r<reset>")
function chatFormat(p: player):
set {playerprefix::%{_p}%'s uuid} to colorFormat({_p}'s prefix)
set {playersuffix::%{_p}%'s uuid} to colorFormat({_p}'s suffix)
set {message} to link({message})
if {_p} has permission "jevents.colors":
broadcast formatted "%{playerprefix::%{_p}%'s uuid}%%{_p}'s name%%{playersuffix::%{_p}%'s uuid}%&f: %{message}%"
else:
broadcast "%coloured {playerprefix::%{_p}%'s uuid}%%coloured {_p}'s name%%coloured {playersuffix::%{_p}%'s uuid}%&f: %{message}%"
function colorFormat(text:text) :: text:
return {_text}.replaceAll("&##([a-fA-F0-9]{6})", "<##$1>")
on chat:
cancel event
set {message} to message
chatFormat(player)
at the moment, this code can only do links of 10 characters after the "https://"
does anyone know how i can make this code work with links of any length