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 comminuty!
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!
handle.getStringArrays().read(0);
string array pinfo 0 of %packet%
"ItemModifier" pinfo %number% of %packet%
set {_packetb} to new play_client_update_sign packet
set {_firstline} to the first element out of string array pinfo 0 of {_packetb}
message "%{_firstline}%"
When making a new packet it doesn't have any of the info -- it's simply a container for the packet. In this case, the string array isn't yet set and so it will be null. You'll have to set it yourself if you want to fake a packet, or use the packet event to intercept incoming onesIm trying, but i can't get it to work. I didn't used packets before, so i need some help
this is what i got so far:
code_language.skript:set {_packetb} to new play_client_update_sign packet set {_firstline} to the first element out of string array pinfo 0 of {_packetb} message "%{_firstline}%"
I tried with the on packet event, but it's getting all the lines like this "[first,second,third,fourth] and I only need the first line..When making a new packet it doesn't have any of the info -- it's simply a container for the packet. In this case, the string array isn't yet set and so it will be null. You'll have to set it yourself if you want to fake a packet, or use the packet event to intercept incoming ones
on packet:
if event-string is "PacketPlayInUpdateSign":
set {_this} to packet field "b"
Then useit's getting all the lines like this "[first,second,third,fourth] and I only need the first line
set {_split::*} to {_text} split at ","
This is skellett's packet syntax. Use MundoSKsI tried with the on packet event, but it's getting all the lines like this "[first,second,third,fourth] and I only need the first line..
code_language.skript:on packet: if event-string is "PacketPlayInUpdateSign": set {_this} to packet field "b"
after I split it, the {_split::*} has nothing in it..Then use
where {_text} is the complete sign text.code_language.skript:set {_split::*} to {_text} split at ","
Then, {_split::1} contains the first line.
As I said, i don't know anything about packets, so even If I use MundoSk, i still can't get the first line from the singThis is skellett's packet syntax. Use MundoSKs
What did you try, with MundoSK? Also, you can't split it because it isn't a text, it's an array object. What you can do with that is either convert the array to a Skript list with Skript-Mirror's spread expression or convert it to a text (surrounding it with quotes and percent signs) then spliting it by a comma and removing the squared brackets from the first and the last object.after I split it, the {_split::*} has nothing in it..
[doublepost=1503249758,1503249627][/doublepost]
As I said, i don't know anything about packets, so even If I use MundoSk, i still can't get the first line from the sing
on packet event play_client_update_sign:
set {_lines::*} to string array pinfo 0 of event-packet
#now {_lines::1} is the first line of the sign.
on sign change:
broadcast "%line 1%"
I was gonna ask the same to be honest, as this event is triggered when a player press the "Done" button and the update sign packet is called while the player is editing the sign.is there a reason you're not using the existing on sign change event?
code_language.skript:on sign change: broadcast "%line 1%"
I created the sign using (open sign editor) packet, and the event is not working with itI was gonna ask the same to be honest, as this event is triggered when a player press the "Done" button and the update sign packet is called while the player is editing the sign.