Hello develupers I want to make a victory badge like canping but this is not working.
I tried to make a remote event script.
The script is a local script inside of starterCharacterScripts there’s no error in output then wath am I doing wrong?
Hello develupers I want to make a victory badge like canping but this is not working.
I tried to make a remote event script.
i used this in a [Server Script] and worked fine
local function AwardBadge(player, badgeId)
print(badgeId)
task.wait(1)
-- Fetch badge information
local success, badgeInfo = pcall(function()
return BadgeService:GetBadgeInfoAsync(badgeId)
end)
if success then
-- Confirm that badge can be awarded
if badgeInfo.IsEnabled then
-- Award badge
local awarded, errorMessage = pcall(function()
BadgeService:AwardBadge(player.UserId, badgeId)
end)
if not awarded then
warn("Error while awarding badge:", errorMessage)
end
end
else
warn("Error while fetching badge info!")
end
end
Using remote event? I need to make a remote event for get badge.
Why are you attempting to award a badge client-side anyway? Even if it did work, (and it wouldn’t because it’s a server-side operation), that would be incredibly insecure.
Badges can only be rewarded from the server(you are using a client script) and they must be part of the current place.
Hummm I want to make a player get a badge at a certain time ie at the end of the game. There’s a way to make it?
Oh them I will clone a part in players location.
How does the game end? Which script ends the game? find that script(which is probably a server script) and make it reward badges when it ends the game.
Questions like this pretty much depend in your game behavior.
This probaby will work for me thanks for your help
A value will work? Okay I will try all of it.
Sorry I don’t understand your question
Basically in order for the game to end, a script has to perform some kind of action, when that action happens, reward the badges inside that script.
Oh yeah I understand I will try it