Gosh it’s been so long since I posted. Good to see y’all again B)
I am completely new to badges; I need some help on why the badge is not being awarded.
local p = game:GetService("Players").LocalPlayer
local b = script.Parent
local bs = game:GetService("BadgeService")
local id = 2126491498
b.MouseButton1Down:Connect(function()
bs:AwardBadge(p.UserId, id)
wait(1)
p:Kick("ur not welcome.")
end)
This is the code that I use.
This is the error. I also tried obtaining the badge from the actual game but still nothing.
local bs = game:GetService("BadgeService")
local id = 2126491498
game:GetService("ReplicatedStorage").GiveBadge.OnServerEvent:Connect(function(plr)
bs:AwardBadge(plr.UserId, id)
end)
DISCLAIMER: Im not sure if it workes but there were no errors while coding or testing
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("badge")
local b = script.Parent
local id = 2126491498
b.MouseButton1Down:Connect(function()
remoteEvent:FireServer(id)
end)
Server:
local bs = game:GetService("BadgeService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("badge")
function givebadge(plr, id)
local userid = plr.UserId
bs:AwardBadge(userid, id)
end
remoteEvent.OnServerEvent:Connect(givebadge)