Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont this script award a badge?

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

1 comment

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'.

1 answer

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

1 comment

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

This discussion is preserved as it was. New answers, comments, and votes are closed.