#Image button and avatar accessory
1 messages · Page 1 of 1 (latest)
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?
it’s an accessory already in the game. in replicated storage. when i was messing around with the code a lil it was child the accessory but not like snap it to the character
yes pls
- 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.
⸻
- Create a RemoteEvent
• In ReplicatedStorage, create a RemoteEvent named GiveAccessory
⸻
- 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)
- 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
won’t be able to try it for the next 4 hours but tysm ur a life saver
Np do you want it so its more neat and you dont get confused