BadgeService + Text Value? What is the correct way?

Hello, currently making a “luck” based game. Basically one of thoughs games where you have a chance to win a small amount of robux. For losing you get a badge called “Better luck next time” and for winning the highest amount you also get a badge. I have tried many ways of getting this to work, but none have worked. I am currently stuck at this, which is a script within ServerScriptService.

local Players = game:GetService("Players")
local badgeService = game:GetService("BadgeService")

Players.PlayerAdded:Connect(function(player)
    local l = player.PlayerGui:WaitForChild("ScreenGui").RewardFrame.Reward
    local playerName = player.Name
    print(l.Text)
    if l.Text == "Congratulations, "..playerName.."  You won 1,000 Robux! DM hryg on Discord to claim! Please send a screenshot as proof!" then
        local badgeId = 2148268031 -- ID of the "1,000 Robux Winner" badge
        badgeService:AwardBadge(player.UserId, badgeId)
    end

    if l.Text == "Hey, "..playerName.." We're sorry but you didn't win anything this time! Feel free to try again!" then
        local badgeId = 2148267957 -- ID of the "No Prize" badge
        badgeService:AwardBadge(player.UserId, badgeId)
    end
end)

I appreciate any form of help you can give!

I believe this goes against the Roblox Terms of Service.

1 Like

it doesn’t, it’s following all the correct ways to not break tos.

From what I know, you’re not allowed to give away Robux.

I think as long as the user isn’t paying Robux for a chance at getting the prize, then it’s ok.

This script is checking a GUI’s text as soon as they join the game from the server side.

How are they being awarded this? Because if it’s as soon as they join the game then you should handle everything server side and then send a RemoteEvent to the client telling it to update the GUI with a message of them winning or losing.

You should really never be checking the text of a GUI from the server.

  1. You’re giving away Robux.
  2. You’re directing users off-platform.

We fixed that bit of tos broken by making 2 options:

  • claim via roblox messages
  • claim via posting on group wall.

After jumping 100 times, they are awarded. It is a chance based prize.

Your current script is checking right after they join the game, you need to check after they jump 100 times.