Hi, I’m trying to make a gui that appears when a player touches a part and it starts awarding badges, while showing how many badges were awarded. So far it makes the gui appear, and doesn’t change the text. I’m going to make it award the badges last, as it is the most simple part. Here is the script I made:
local badges = {000,001,002}
local a = script.Parent.badgenumber
local badgeService = game:GetService("BadgeService")
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.PlayerGui.ScreenGui.b.Visible = true
player.PlayerGui.ScreenGui.Frame.Visible = true
for i, badge in pairs(badges) do
wait(1)
a.Value = a.Value + 1
player.PlayerGui.ScreenGui.Frame.TextLabel.Text = (a).."/3"
end
end
end)
If you see anything wrong please let me know.