script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChild('Humanoid') then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
game:GetService("BadgeService"):AwardBadge(player.UserId, 2124586648)
end
end)
local debounce = false
script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChild('Humanoid') then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
game:GetService("BadgeService"):AwardBadge(player.UserId, 2124586648)
if not debounce then
debounce = true
wait(2)
debounce = false
end
end
end)
script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChild('Humanoid') then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if game:GetService("BadgeService"):UserHasBadgeAsync(player.UserId, 2124586648) then
--Nothing, you got the badge already.
else
game:GetService("BadgeService"):AwardBadge(player.UserId, 2124586648)
end
end
end)
Here, instead of having an empty space, you could use not to shorten it, like
if not game:GetService("BadgeService"):UserHasBadgeAsync(player.UserId, 2124586648) then
game:GetService("BadgeService"):AwardBadge(player.UserId, 2124586648)
end