Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont this script award a badge?

Asked by 9 years ago

This script is supposed to award a badge when you click on a GUI button called "Claim badge" but it doesn't work...

function onClick()
    player = script.Parent.Parent.Parent.Parent.Parent
    b = game:GetService("BadgeService")
    b:AwardBadge(player.userId,167923795)

end

script.Parent.MouseButton1Click:connect(onClick)

The hierarchy of the GUI is:

Player -- Player Gui ----ScreenGui ------Frame --------TextButton -----------Script

Thanks, MD

0
Are you sure that it is your own badge in the designated place? You checked the Player's badges and it's not there? If the answer to these questions are Yes, then ROBLOX must have broken it. They've made some methods only accessible in a localscript. Try using a local script, with the player variable defined as 'player = game.Players.LocalPlayer'. Shawnyg 4330 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

How does the GUI appear? When you go past the finish, it pops up or what?

0
At the end of a series of GUI questions, you click "Next" and then theres a button in a frame that becomes visible. You click on it and this script runs MasterDaniel 320 — 9y
Ad

Answer this question