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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
set {_list::*} to split "blalfdk dsjds||Chance: 13||wsj1ldsjk" by "||"
loop {_list::*}:
if "%loop-value% " contains "Chance":
set {_1} to loop-value
replace all "Chance: " in {_1}
True, if he expects to have more things than the 3 he used in the example he can use this:@TPGamesNL not at all because he may have more lines and more "||"s so it wouldnt work properly..
set {_l::*} to split "blalfdk dsjds||Chance: 13||wsj1ldsjk" at "||"
loop {_l::*}:
set {_c::*} to loop-value parsed as "Chance: %number%"
{_c::1} is set
exit loop
# {_c::1} will contain 13
set {_list::*} to split "blalfdk dsjds||Chance: 13||wsj1ldsjk" by "||"
loop {_list::*}:
if "%loop-value% " contains "Chance":
set {_1} to loop-value
replace all "Chance: " in {_1}
But then it isn't parsed as a numberYes, but he can use this too:
code_language.skript:set {_list::*} to split "blalfdk dsjds||Chance: 13||wsj1ldsjk" by "||" loop {_list::*}: if "%loop-value% " contains "Chance": set {_1} to loop-value replace all "Chance: " in {_1}![]()
set {_list::*} to split "blalfdk dsjds||Chance: 13||wsj1ldsjk" by "||"
loop {_list::*}:
if "%loop-value% " contains "Chance":
set {_l} to loop-value # {_l} = "Chance 13";
replace all "Chance: " in {_l} with "" # {_l} = "13";
set {_l} to {_l} parsed as number # {_l} = 13;
1. edited, try againBut you cant parse string "Chance: 13" as int..
So..
1. Your code is reporting error for me ({_c} can only be set to one object, not more)
2. By my logic "set {_c} to loop-value parsed as "Chance: %number%"" will set variable to "Chance: 13"
3. And if you have variable which is string ("Chance: 13"), you cannot parse it as integer...
4. You said that people usually want variable which contains only number parsed as number.. but your code will parse it as text.. (probably, i cant test it bcs i getting error..)
code_language.skript:set {_list::*} to split "blalfdk dsjds||Chance: 13||wsj1ldsjk" by "||" loop {_list::*}: if "%loop-value% " contains "Chance": set {_l} to loop-value # {_l} = "Chance 13"; replace all "Chance: " in {_l} with "" # {_l} = "13"; set {_l} to {_l} parsed as number # {_l} = 13;
set {_l} to "test123" parsed as number
broadcast "%{_l}%"
[17:23:33 INFO]: <none>
So at your first point you are saying you don't get any errors, but in your second point you did get errors? Did you change your skript version in the meanwhile or what have you done?1. OK its working now.
2. "(probably, i cant test it bcs i getting error..)"
3. No, you are wrong
code_language.skript:set {_l} to "test123" parsed as number broadcast "%{_l}%"4. see 2.Code:[17:23:33 INFO]: <none>
set {_l} to "test123" parsed as number
broadcast "%{_l}%"
set {_l::*} to "test123" parsed as "test%number%"
broadcast "%{_l::1}%"
command /test <text>:
trigger:
set {_l::*} to arg-1 parsed as "test%number%"
broadcast "%{_l::1}%"
broadcast "%{_l::1}% * 2 = %{_l::1} * 2%"
set {_chance::*} to uncolored {_line} parsed as "Chance: %number%" for {_line} in split lore of player's tool by "||"