(I'm new to scripting) I need help in script. (BadgeService)

Hello, i need help
I’m new to lua and started learning it today.
So i have a script,
This is a script for ui button
When you pressing it, sound plays
and awards you with badge, but i don’t know how to make badge award after this
So please if you can help me with that. (This is local script)

local Debuff = game.Players.LocalPlayer -- Local Player
script.Parent.MouseButton2Click:Connect(function() -- Function
	script.Parent.Sound:Play() -- Plays Sound
	Debuff.Character.Humanoid.Health -= 10
	Debuff.Character.Humanoid.WalkSpeed *=10
	wait(0.7)
	Debuff.Character.Humanoid.WalkSpeed = 16
-- And here local player must  be awarded with badge
	

	
end)

All the info you need should be here: Badges | Documentation - Roblox Creator Hub

1 Like
game:GetService('BadgeService'):AwardBadge(Player.UserId,badgeId)
1 Like