I have a GUI and when I click the image label more than once it gives the hat, but in clones! Super annoying, please help!
The GUI buttons have string values under them to reference the hats I want to clone when they press a button.
Server Script Service:
local chooseHats = game.ReplicatedStorage:WaitForChild("ChooseHats")
local hatsFold = game.ReplicatedStorage:WaitForChild("Accessories")
chooseHats.OnServerEvent:Connect(function(player,fullName)
local character = player.Character
local accessory = hatsFold:FindFirstChild(fullName)
local cloneHat = accessory:Clone()
cloneHat.Parent = character
end)
Local Script under the main GUI:
local chooseHats = game.ReplicatedStorage:WaitForChild("ChooseHats")
local hatsFold = game.ReplicatedStorage:WaitForChild("Accessories")
local player = game.Players.LocalPlayer
local storedValue = nil
for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA("ImageButton") or v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
local fullName = v:WaitForChild("Accessory").Value
chooseHats:FireServer(fullName,player)
end)
end
end

2 comments
Hello. I will try to help you!
Add https://www.roblox.com/users/24398509/profile to place so he could help you.