Jump to content

Getting Last Line of Lore on Item


agagagagagagagagag

Recommended Posts

set lore of player's tool to "%lore of player's tool%||NEW LINE"

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Just now, agagagagagagagagag said:

no, just the last line of lore. If I had an item with 5 lines of lore, I just want to get the 5th (last) line of lore. That is all of the lore.

Oh get. The thing about just sets the last line. try like

 

set {_a} size of (lore of player's tool split by "||")
set {_s} to 1
loop {_a} times:
	set {_l} to line {_s} of lore of player's tool
	add 1 to {_s}


Then use {_l}. There probably is a way easier way to get it but not sure. Try this.
 

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

very good tarna

Graphic Designer - Skript Developer - Professional Builder - Content Creator

Been on Minehut since January 2018. Throughout my time here I've mastered the skills you see above. I make free logos, banners, and server art for users on Minehut. I'm a proficient Skript developer. I'm also really good at building, you can see my portfolio by clicking here. Feel free to say hi if you see me somewhere 🙂

Amethyst Studios Discord

Link to comment
Share on other sites

4 minutes ago, farwl said:

very good tarna

Would the thing I said work? Or is there an easier way. You are probably better than Skript than me.

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

3 hours ago, _Tarna_ said:

Would the thing I said work? Or is there an easier way. You are probably better than Skript than me.

If that effect worked, then you wouldnt need all that extra stuff, just line 4. However, I cant remember if that effect is a real one, so heres an alternate solution that might work:

  1. set {_split::*} to lore of player's tool split at "||"
  2. loop {_split::*}:
        add 1 to {_num}
  3.     set {_line%loop-number%} to {_split::%loop-number%}
  4. send "The last line of the lore of player's tool is %{_line%{_num}%}%"
Yes, I know this can be simplified but I'm on mobile. The skript should work anyways.
Edited by Tresre
Link to comment
Share on other sites

On 8/3/2020 at 12:33 AM, Tresre said:

If that effect worked, then you wouldnt need all that extra stuff, just line 4. However, I cant remember if that effect is a real one, so heres an alternate solution that might work:

  1. set {_split::*} to lore of player's tool split at "||"
  2. loop {_split::*}:
        add 1 to {_num}
  3.     set {_line%loop-number%} to {_split::%loop-number%}
  4. send "The last line of the lore of player's tool is %{_line%{_num}%}%"
Yes, I know this can be simplified but I'm on mobile. The skript should work anyways.

Doesn't work, says "The last line of the lore player's tool is <none>" I am holding a tool with multiple lines of lore.

Link to comment
Share on other sites

8 hours ago, agagagagagagagagag said:

Doesn't work, says "The last line of the lore player's tool is <none>" I am holding a tool with multiple lines of lore.

Heya!

That loop on the previous skript seems unnecessary. The problem is that {_num} and loop-number in that context would always be the same. You could probably get that previous skript to work if you just used {_num} instead.

I made a different skript anyways, it should work perfectly fine.

set {_0} to lore of player's tool
set {_1::*} to split {_0} at "||"
set {_0} to size of {_1::*}
send "The last line of lore is line %{_0}%!"

Always feel free to contact me or continue this thread if you need more help.
❤️😄 

Edited by AWorthySon

 

image.png.e46e91961f1d6d4604a6e5f3dcb5a2bd.png

unknown.pngunknown.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...