Anarchick / skript-packet

Another skript's packet addon to replace ThatPacketAddon with skript2.5.2+
MIT License
21 stars 4 forks source link

Issue with "on packet event PLAY_CLIENT_STEER_VEHICLE" #5

Closed RealRayli closed 3 years ago

RealRayli commented 3 years ago

[00:46:45 ERROR]: event-types.packet is not an nbt compound (Fahrzeug.sk, line 554: set {_l} to float pnum 0 of event-packet') [00:46:45 ERROR]: event-types.packet is not an nbt compound (Fahrzeug.sk, line 555: set {_f} to float pnum 1 of event-packet') [00:46:45 ERROR]: event-types.packet is not an nbt compound (Fahrzeug.sk, line 556: set {_jump} to boolean pinfo 0 of event-packet') [00:46:45 ERROR]: event-types.packet is not an nbt compound (Fahrzeug.sk, line 557: set {_exit} to boolean pinfo 1 of event-packet')

Hi, i get this error for this code:

on packet event PLAY_CLIENT_STEER_VEHICLE: if name of player's vehicle contains "FZ": set {_NameOf} to name of player's vehicle set {_Fahrzeug} to "%{_NameOf}%" set {_l} to float pnum 0 of event-packet set {_f} to float pnum 1 of event-packet set {_jump} to boolean pinfo 0 of event-packet set {_exit} to boolean pinfo 1 of event-packet

As i used ThatPacketAddon all was fine. I replaced that addon with yours because of uprading to 1.17 Can you please help by rewriting or fix that?

Anarchick commented 3 years ago

Skript-Packet does not use exact same syntaxes of TPA, you should take a look on exemples from

Cause packets can be different in each version of MC you should use this methods :

on packet event play_client_steer_vehicle:
    broadcast "<pink>%all fields of event-packet%"
    broadcast "<lime>%all fields classes of event-packet%"

For me in 1.16.5 it says : image

So the code with Skript-packet 1.2+ (not released yet) is

on packet event play_client_steer_vehicle:
    set {_sideways} to field 0
    set {_forward} to field 1
    set {_jump} to field 2
    set {_unmount} to field 3

If you're using 1.1 you have to replace field X by field X of event-packet

RealRayli commented 3 years ago

Hi and thank you very much for rewriting 👍 it works fine now.