Invsee With MadCommands

This is a script that keeps updating the runner's inventory to the inventory of the desired player every second! While this does not have the ability to change their inventory, it allows you to see theirs in real time.

This is a script that keeps updating the runner's inventory to the inventory of the desired player every second! While this does not have the ability to change their inventory, it allows you to see theirs in real time. To stop viewing their inventory, simply run /invsee again for it to stop. If you see a way to improve this code make sure to comment!

10 if varset(%args%[1]) = %false% then goto 100
11 let %pl% = %args%[1]
12 let %inv% = playerinventory(%pl%)
13 let %ar% = playerarmor(%pl%)
14 let %old% = playerinventory(%p%)
15 let %olda% = playerarmor(%p%)
16 carry %p% %inv%
17 wear %p% %ar%
18 message %p% “§aYou are now looking at %pl%’s inventory”
20 load %invsee%
21 let %invsee%[%p%] = 1
22 save %invsee%
23 #Loop
24 sleep 1
25 load %invsee%
26 if %invsee%[%p%] = 0 then goto 150
27 let %inv% = playerinventory(%pl%)
28 carry %p% %inv%
29 let %ar% = playerarmor(%pl%)
30 wear %p% %ar%
31 goto 23
100 #100
101 load %invsee%
102 if %invsee%[%p%] = 1 then goto 125
103 message %p% Usage: /invsee (player)
104 exit
125 #125
126 let %invsee%[%p%] = 0
127 save %invsee%
128 message %p% §aInvsee is now disabled
129 exit
150 #150
152 carry %p% %old%
153 wear %p% %olda%
154 exit