New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why Wont this Badge Reward at the end of the Test? - AWNSERED

Asked by 4 years ago

Okay So your suppose to take This GUI Test... and at the end you get a Badge.. But it wont work.. Any advice?

Badge = 213632109
function Award()
game:GetService("BadgeService"):AwardBadge(game.Players.LocalPlayer.userId, Badge)
end
while wait() do
if game.Players.LocalPlayer.PassedStorage.One.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Two.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Three.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Four.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Five.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Six.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Seven.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Eight.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Nine.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Ten.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Eleven.Value == true
then
if game.Players.LocalPlayer.PassedStorage.Twelve.Value == true
then
Award()
end
end
end
end
end
end
end
end
end
end
end
end
end

1 answer

Log in to vote
0
Answered by
Goulstem 8062 Badge of Merit Moderation Voter Administrator Community Moderator
4 years ago

I don't know why it wouldn't award you the badge unless either that's an invalid badge ID or you never met all the conditions.

Try this.. I revised it a bit.

local Badge = 213632109
local plr = game.Players.LocalPlayer
local st = plr.PassedStorage
local qs = {st.One,st.Two,st.Three,st.Four,st.Five,st.Six,st.Seven,st.Eight,st.Nine,st.Ten,st.Eleven}

function check()
    a = true
    for i,v in pairs(qs) do
        if v.Value ~= true then a = false break end
    end
    return a
end

function Award()
    game:GetService("BadgeService"):AwardBadge(plr.userId, Badge)
end

while wait() do
    if check() == true then
        Award()
    end
end
0
Now Goul, Is there suppose to be something that keeps track of this or something.. Like an Leaderboard? Because its still not working. MicrobeBlox 5 — 4y
Ad

Answer this question