Hello again I’m here to explain and ask for the help of you more experienced in creating games on the platform, to solve a problem I’m having when trying to grant an emblem to the user in all the ways I need, such as when he enters the game or steps on a specific part could you help?
Well, I’ll start by talking about the group I’m producing the game with, and this one:
Detail all are active and functional according to test scripts to see if the badge is functional across the console, and I’ll send you some of the script code that I tested and worked in my games outside the group but on my personal account:
Here it shows that in the direct game on my account the script works.
Meanwhile, in the game made in my group, it says that the bedge is functional and that it was successfully granted, but the user does not receive it in the inventory and does not even appear on the player’s screen (the element ID is correct and it is active)
Anyone who can help me would be grateful and I’m sure the error is not occurring in the script and I have all the permissions to my group since I paid it and created it but I came across this:
Simple, I’m trying to give the user an emblem when he steps on the part that appears in the photo and if it’s functional he gets the badge and if not it’s said he doesn’t get it but the script says it’s functional but the badge doesn’t fall on the player’s account
Could you provide us with the part of the script that’s not working? Maybe there’s something you´re not considering.
Is the script working through a conditional?
Is it a local script?
local badgeid = 1234578
local playerid = 54321
local badgeservice = game:GetService("BadgeService")
--whoops
if not badgeservice:UserHasBadgeAsync(playerid, badgeid) then
print("badge awarded to player")
badgeservice:AwardBadge(playerid, badgeid)
else
print("user has badge!!")
end
local badgeId = 3639477158844045 – Substitua pelo ID do emblema que você deseja conceder
local function onTouched(other)
local character = other.Parent
local player = Players:GetPlayerFromCharacter(character)
if player then
local success, errorMessage = pcall(function()
BadgeService:AwardBadge(player.UserId, badgeId)
end)
if success then
print("Badge has been awarded to " .. player.Name .. "!")
else
print("Badge has not been awarded to " .. player.Name .. ": " .. errorMessage)
end
end