Jump to content

Setting line of sign not working


Recommended Posts

Hi, when I set a variable to a location, and then do something simple such as 

set 1st line of {location} to "Test"

It wont work.
Other things such as

on rightclick on sign:
	set 1st line of event-block to "Success!"

will work.
Does anybody have an explanation for why it won't do it in the top?

Link to comment
Share on other sites

Hello choodles, I believe I understand why!

as you may have noticed, set the 1st line of {location} to “Test” gets parsed correctly, in other words, skript will tell you it has been ‘loaded without any errors’. Although when skript sees {location}, it is looking for a block rather than a set of coordinates

(check this skript hub page for reference https://skripthub.net/docs/?id=978https://skripthub.net/docs/?id=978)

As you can see, it says the expression must go like this: line (number of line goes here) of (block goes here). Although specifying coordinates seems like enough skript needs you to tell it you are talking about the block of those coordinates rather than the coordinates themselves. 
So rather than doing this:

set {location} to (whatever your location was)

Do this:

set {location} to block at location at (0, 0, 0) 

Of course you can specify your own x, y, z coordinates that are suitable for you!

Hope that made sense! 🙂


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...