Help with makeing accesories shop

Guys if anyone knows how to make accessories shop so when i open shop i can buy with my currency in game and than i have it on ?
image
And my currency is wins…

If this post gets down i am gonna be sad i cant find any videos to help

8 Likes

Actually a lot involved in that …
Here are 2 tutorials that together may help you figure this all out.
Make a shop and Hat choosing system
Maybe this one too Make a hat shop

There are many more example of this once your in this area.
Suggest really learning the 1st one. He’s pretty good and easy to learn from.

2 Likes

Put this local script in a button for each accessory(Text or image)
Make sure to read the notes i provided in the code!

local player = game:GetService("Players").LocalPlayer

script.Parent.MouseButton1Up:Connect(function()--When parent (GUI Button) is clicked.
	if player.leaderstats.EXAMPLELEADERSTATVALUE.Value >= 25 then --Change EXAMPLELEARDERSTATVALUE to your cash value.
		player.leaderstats.EXAMPLELEADERSTATVALUE.Value = player.leaderstats.EXAMPLELEADERSTATVALUE.Value - 25
		game:GetService("ReplicatedStorage").EXAMPLEVENT1:FireServer()--Put a RemoteEvent in ReplicatedStorage. Each accessory requires its own event.
	end
	--Change the both 25's with the your price
end)

A regular script in Workspace (As said in the script, there should be a script and RemoteEvent for each hat)

local accessory = game:GetService("ServerStorage").EXAMPLEACCESSORY --The name of your accessory in ServerStorage.

game.Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Connect(function(Character)
		
		game:GetService("ReplicatedStorage").EXAMPLEVENT1.OnServerEvent:Connect(function()
			local Humanoid = player.Character:WaitForChild("Humanoid")
			local accessoryClone = accessory:Clone()
			accessoryClone.Parent = game:GetService("ReplicatedStorage")
			
			Humanoid:AddAccessory(accessoryClone)
		end)
	end)
end)

Wish you luck!

3 Likes