Jump to content

[Skript]


TrainerX

Recommended Posts

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#1807
Servers: Repository BoomTag (Both WIP)

Your Achievement


 

Link to comment
Share on other sites

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)

Screen Shot 2020-03-20 at 5.23.33 pm.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...