TrainerX Posted April 21, 2020 Share Posted April 21, 2020 How do i detect the number of lines of lore a tool has? If I use set line 12 of lore of tool to "Fortune %{fortune.%player%}%" then the textbox would appear very large Link to comment Share on other sites More sharing options...
Magician Posted April 21, 2020 Share Posted April 21, 2020 There is probably an expression for it but you can use a function such as: function loreLength(i: item):: integer: set {_n} to 0 while {_n} is set: if line ({_n} + 1}) of {_i}'s lore is set: add 1 to {_n} else: exit loop return {_n} Then using that function, you can do something along the lines of: command /lorelength: trigger: set {_a} to loreLength(tool) send "This item has %{_a}% lines of lore." I broke it down a little so it's easier to understand. Hopefully this helps. The indentation is kinda big but that's just how Minehut forums converts TABs. Discord: Rqdioqctive#1807Servers: Repository + BoomTag (Both WIP) Link to comment Share on other sites More sharing options...
Migins Posted April 22, 2020 Share Posted April 22, 2020 If you can, it would be easier if you didn't use a function and just used it directly in the command. Functions (in skript) load considerably slower. ► Support July 29, 2020 → November 3, 2020 ► Helper November 3, 2020 → February 22, 2021 ► Moderator February 22, 2021 → May 17, 2021 ► I might not always respond to forum dms, however I am always contactable on discord (mig#0069) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now