#Image button and avatar accessory

1 messages · Page 1 of 1 (latest)

vale topaz
#

I’ve been going at this for the past 3 hours and I can’t figure out how give the player an accessory (3d clothing, sunglasses, etc) from an image button.

placid crown
#

remote event.

#

@vale topaz

void basin
#

i think he wanted more than that mate

#

come on

#

what's your code now @vale topaz ?

#

what have you tried

#

is it an accessory in the game already, or one from the site?

gentle bison
#

I know how to do this step but step

#

Want it?

vale topaz
vale topaz
gentle bison
#
  1. Set Up the Accessory in ReplicatedStorage
    • Put your accessory (example: “CoolGlasses”) inside ReplicatedStorage.
    • Make sure it’s a proper Accessory object, not just a MeshPart.

  1. Create a RemoteEvent
    • In ReplicatedStorage, create a RemoteEvent named GiveAccessory

  1. Client Script (inside the ImageButton)

Put this LocalScript inside your ImageButton:

#

local button = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local giveAccessory = ReplicatedStorage:WaitForChild("GiveAccessory")

button.MouseButton1Click:Connect(function()
giveAccessory:FireServer("CoolGlasses") -- The name of the accessory
end)

#
  1. Server Script (ServerScriptService)

Now handle giving the accessory from the server. Create a Script in ServerScriptSer

#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local giveAccessory = ReplicatedStorage:WaitForChild("GiveAccessory")

local AccessoriesFolder = ReplicatedStorage -- or ServerStorage if you prefer

giveAccessory.OnServerEvent:Connect(function(player, accessoryName)
local accessory = AccessoriesFolder:FindFirstChild(accessoryName)
if not accessory then
warn("Accessory not found:", accessoryName)
return
end

-- Clone and give to character
local char = player.Character
if char and char:FindFirstChild("Humanoid") then
    local cloned = accessory:Clone()
    cloned.Parent = char
end

end)

#

Important Notes:
• Make sure your accessory is valid (includes Attachment names that match body parts).
• Use Accessory type objects — not just MeshParts or Hats unless you script their welds manually.
• Make sure ResetOnSpawn is off for the GUI if needed.

#

I done this before so js do it step by step

vale topaz
#

won’t be able to try it for the next 4 hours but tysm ur a life saver

gentle bison
#

Np do you want it so its more neat and you dont get confused

vale topaz
#

sure lol

#

if you can get it all in one msg that would be great, i pretty much understand it regardless but if u can simplify it pls do