I duplicated this script, it broke.

Back
Eero
Join Date:
Posts:
Streak:
Feb 2023
5796
18 days
7 months ago | 28 • By Eero 18d

Emir gave me this code to use for awarding achievements, I duplicated it for more achievements and it broke all of them.


local BadgeID = 00000 --change it with your badge ID with the zeros
local AwardPart = game["Environment"]["Part"] --change it with the path to the part


AwardPart.Touched:Connect(function (other)
if other:IsA("Player") then
Achievements:Award(other.UserID, BadgeID, function(success, error)
if success then
print("Awarded achievement")
else
print("Error awarding achievement: " .. error)
end
end)
end
end)


What do I do?



i dunno what do you want ?

MistInferno
Join Date:
Posts:
Aug 2022
401
7 months ago • By MistInferno

Hey dude idk if this is accurate I used a advanced ai search engine to make a code that grants you more than one badges


AI RESULTS


To grant more than one badge in-game using the provided Lua code, you can modify the code to accept a list of badge IDs instead of a single ID. Here's an example of how you can modify the code:
lua
local BadgeIDs = {00001, 00002, 00003, 00004, 00005} -- Change this list with your desired badge IDs


AwardPart.Touched:Connect(function (other)
if other:IsA("Player") then
for _, BadgeID in pairs(BadgeIDs) do
Achievements:Award(other.UserID, BadgeID, function(success, error)
if success then
print("Awarded achievement " .. BadgeID)
else
print("Error awarding achievement " .. BadgeID .. ": " .. error)
end
end)
end
end
end)


In this modified code, the BadgeIDs table contains a list of badge IDs that you want to grant. The pairs function is used to iterate over each ID in the list, and the Achievements:Award function is called for each ID. This will grant all the badges specified in the BadgeIDs table to the player when they interact with the AwardPart.


Eero OP
Join Date:
Posts:
Streak:
Feb 2023
5796
18 days
7 months ago • By Eero OP 18d
MistInferno
MistInferno 7 months ago
Hey dude idk if this is accurate I used a advanced ai search engine to make a code that grants you more than one badges AI RESULTS To grant more than one badge in-game using the provided Lua code, you can modify the code to accept a list of badge IDs instead of a single ID. Here's an example of how you can modify the code: lua local BadgeIDs = {00001, 00002, 00003, 00004, 00005} -- Change this list with your desired badge IDs AwardPart.Touched:Connect(function (other) if other:IsA("Player") then for _, BadgeID in pairs(BadgeIDs) do Achievements:Award(other.UserID, BadgeID, function(success, error) if success then print("Awarded achievement " .. BadgeID) else print("Error awarding achievement " .. BadgeID .. ": " .. error) end end) end end end) In this modified code, the BadgeIDs table contains a list of badge IDs that you want to grant. The pairs function is used to iterate over each ID in the list, and the Achievements:Award function is called for each ID. This will grant all the badges specified in the BadgeIDs table to the player when they interact with the AwardPart.

that's smart, but I want the badges to give in specific parts. not all in one
it would be quicker that way so i might consider.



i dunno what do you want ?

Index
Join Date:
Posts:
Streak:
Sep 2019
914
9 days
6 months ago • By Index 9d

Just to verify, you are changing the BadgeID and AwardPart variables to the correct values right? Like for each part, changing the AwardPart variable path to that part and not a different one.


Sorry, just want to make sure.



hey, I'm Index!

Eero OP
Join Date:
Posts:
Streak:
Feb 2023
5796
18 days
6 months ago • By Eero OP 18d
Index
Index 6 months ago
Just to verify, you are changing the `BadgeID` and `AwardPart` variables to the correct values right? Like for each part, changing the `AwardPart` variable path to that part and not a different one. Sorry, just want to make sure.

I don't know how to script, emir just gave it to me.
I am learning how to script and I don't know but I will try.



i dunno what do you want ?

Eero OP
Join Date:
Posts:
Streak:
Feb 2023
5796
18 days
6 months ago • By Eero OP 18d
Index
Index 6 months ago
Just to verify, you are changing the `BadgeID` and `AwardPart` variables to the correct values right? Like for each part, changing the `AwardPart` variable path to that part and not a different one. Sorry, just want to make sure.

oh yeah before i did that i forgot



i dunno what do you want ?

Eero OP
Join Date:
Posts:
Streak:
Feb 2023
5796
18 days
6 months ago • By Eero OP 18d
Eero
Eero 6 months ago
oh yeah before i did that i forgot

I might try it again.



i dunno what do you want ?

Eero OP
Join Date:
Posts:
Streak:
Feb 2023
5796
18 days
6 months ago • By Eero OP 18d
Index
Index 6 months ago
Just to verify, you are changing the `BadgeID` and `AwardPart` variables to the correct values right? Like for each part, changing the `AwardPart` variable path to that part and not a different one. Sorry, just want to make sure.

did it, did NOT work



i dunno what do you want ?