Hello guys, I want to know if this is a right way to give a badge or not because I tried searching up many instructions as possible but most of them doesn’t help. I did try this in an actual roblox game in my game and see if the boss is killed, the remoteevent trigger to this localscript below which this is in the StarterPlayer >> StarterPlayerScripts and I didn’t actually got a badge because of the UserId error thingy? if I’m wrong, will you guys correct it for me?
local Event = game.ReplicatedStorage.Events:WaitForChild("BossDefeated")
local SansTalk = game.Workspace.SansTalk
local teleportService = game:GetService("TeleportService")
local PlaceID = 6319191217
local BadgeService = game:GetService("BadgeService")
local PlayerService = game:GetService("Players")
BadgeId = 2124681279
local function typewrite(object,text,length)
for i = 1,#text,1 do
object.Text = string.sub(text,1,i)
wait(length)
end
end
game.ReplicatedStorage.Events.BossDefeated.OnClientEvent:Connect(function(player)
BadgeService:AwardBadge(player.UserId, BadgeId) -- is this the right way to give player badge?
script.Parent.Parent.PlayerGui.VictoryMessage.Enabled = true
wait(4)
SansTalk:Play()
typewrite(script.Parent.Parent.PlayerGui.VictoryMessage:WaitForChild("TextLabel"),"Okay, Fine. You defeated me!",0.05)
SansTalk:Stop()
wait(1)
SansTalk:Play()
typewrite(script.Parent.Parent.PlayerGui.VictoryMessage:WaitForChild("TextLabel"),"I did buy mass amounts of iPads just so that",0.01)
SansTalk:Stop()
wait(1)
SansTalk:Play()
typewrite(script.Parent.Parent.PlayerGui.VictoryMessage:WaitForChild("TextLabel"),"I can use these as my alt accounts to pretend to be my friends.",0.01)
SansTalk:Stop()