Question on how i would get on this function HAT ON PLAYER PROBLEM

ello once again,

so i currently want to create a tool wich when you press a gui appears on your screen with imagebuttons on different hats you can choose from.

I already got the toolscript with the gui appearing however how do i make the hat acually go on the player and the right position ? is there any “command” or do i have to fiddle around with cframe ? and parenting.

Also what would be the best possible way should the hat in my game be a normal part with a mesh or a meshpart or a Accessory?

Also when i was getting some hats off the toolbox in one hat i found this attachment ? https://gyazo.com/c74627575078fb6313b56ee93e99d02b

my gui https://gyazo.com/c6965d5405fff8055fc0a4555b77a7a3

Well, you could fire a remote event to the server and run a for i, v in pairs loop to find a accessory and replace the mesh and texture id, but that probably wouldn’t work because of other accessories.

i will put them in a folder in repicated storage. That also isnt my problem
my legit problem is how do i get this hat on the player

U would use Humanoid:AddAccessory(accessory). Doing this on a LocalScript would not make it replicate to the server. So u would fire a RemoteEvent when the menu gets closed or something like like that to change add the accessory on the server.

U would also delete the previous accessory

A players head has a hat attachment so maybe you can use that.

what really ? meaning if the player itself has hair and i do that addaccessory it deletes his hair ?

No, i meant that you also have to delete the previous accessory, in the script.

ion understand do you mean if the player already equipped a hat off the menü ? before giving him a new one i have to delete his current one right ?

1 Like