Each brick in my game has a value, and it gets added to leaderstats. But, I want a GUI to show how many BRICKS they have collected. For example, 2 bricks in my game are worth 32 points to be stored in leaderstats. Instead of showing the total, 64, i want it to show the amount of bricks i collected: 2.
Here is the code that collects the bricks and stores them in leaderstats:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
if db == true then
db = false
script.Parent.Transparency = 1
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.ElectoralVotes.Value = player.leaderstats.ElectoralVotes.Value + 37.5
script.Sound:Play()
wait(1)
script.Parent:Remove()
end
end
end)
I want to keep the leaderstats in the top right, but on the screen i also want it to show the amount of bricks collected. Does anyone know how i could implement this into my game?