Need help with a string

  • 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 community!

    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.

Oviko

Member
Jan 27, 2017
3
0
0
Hello guys and thank you in advice for reading this and trying to help me.

The thing is that i need to execute a console command wich is a title. And inside of the title i need to put a variable.

The console says that is an error because of the {} of the variable are not compatible with the /title command.

I need help to concat " /title %player% title [ ... ... ... " + {variable} + " ... ... ... ]"

code_language.skript:
Real example:

console command "/title %player% title ["" "",{""text"":""<-| "",""color"":""gold""},{""text"":""  %{_TempRand}% "",""bold"":true,""color"":""yellow""},{""text"":""|->"",""color"":""gold""}]"
 
Hello guys and thank you in advice for reading this and trying to help me.

The thing is that i need to execute a console command wich is a title. And inside of the title i need to put a variable.

The console says that is an error because of the {} of the variable are not compatible with the /title command.

I need help to concat " /title %player% title [ ... ... ... " + {variable} + " ... ... ... ]"

code_language.skript:
Real example:

console command "/title %player% title ["" "",{""text"":""<-| "",""color"":""gold""},{""text"":""  %{_TempRand}% "",""bold"":true,""color"":""yellow""},{""text"":""|->"",""color"":""gold""}]"
Just use skRayFall:
code_language.skript:
send player title "&9HEY!" with subtitle "&7You rule!" for 10 seconds
https://www.skunity.com/SkRayFall
 
That doesn't work. it sends the %{variable}% as "%{variable}% not the value of the variable
 
That was a function of my old api:
code_language.skript:
function sendTitle(p: player , title: text , tbold: boolean , titalic: boolean , tunderlined: boolean , tcolor: text , subtitle: text , sbold: boolean , sitalic: boolean , sunderlined: boolean , scolor: text , duration: number) :: text:
    set {_duration} to "%{_duration}%"
    set {_durationRESULT} to ({_duration} * 20)
    make console execute command "/title %{_p}% times 20 %{_durationRESULT}% 20"
    make console execute command "/title %{_p}% subtitle {""text"":""%{_subtitle}%"",""bold"":%{_sbold}%,""italic"":%{_sitalic}%,""underlined"":%{_sunderlined}%,""color"":""%{_scolor}%""}"
    make console execute command "/title %{_p}% title {""text"":""%{_title}%"",""bold"":%{_tbold}%,""italic"":%{_titalic}%,""underlined"":%{_tunderlined}%,""color"":""%{_tcolor}%""}"
    
#Ex: sendTitle(player , "TEST" , true , false , false , "aqua" , "YODAAH API" , false , false , true , "dark_red" , 5)
 
That doesn't work. it sends the %{variable}% as "%{variable}% not the value of the variable
I'm using this on my server and everything is working totally fine! That works with variables too
 
Status
Not open for further replies.