#Hello! How may i change the offhand of a player to what the player is holding?

1 messages · Page 1 of 1 (latest)

strange swift
#

And i also want to know what the player is holding in their current hand.

#

So i will check what the player is holding if its totem then it will go to offhand when i rightclick

strange swift
#

daa

mild citrus
mild citrus
#

np

#

I also have an easier method

#

are you using typescript or javascript?

#

so I know which file to send you

#

so you can just do player.heldItem instead of all of that

#

@strange swift

strange swift
mild citrus
#

k

#

I'ma send you a JS file that you can import to add some useful methods to the Entity prototype, but if you want me to send it you have to credit me, since I spent quite a while making it.

#

I'll send it in a few hours, when I get the chance.

#

it is from one of my add-ons

#

Are you using VSCode?

#

If so, I can also send you the .d.ts file for the autocomplete to detect the custom accessors and methods.

strange swift
strange swift
#

also it won't be public

mild citrus
#

lol, I just realized I answered like 17 posts in the last hour

mild citrus
#

If you need, I can help you switch your JavaScript code to TypeScript, I have helped many people with that before.

strange swift
#

Nah i'm fine ty

#

i just started learning ks

#

JS

mild citrus
#

oh ok

#

well I actually used TypeScript when I first started using script API