I have a game with around 15 badges where I want to make it so, when a players gets said badge, they also get a tool in their backpack, specifically tools located inside a folder in server storage
A script like that would work like this. Compare the badge id to the tools in the table and if they match, give the tool to the player.
local Players = game:GetService("Players")
local BadgeService = game:GetService("BadgeService")
local ServerStorage = game:GetService("ServerStorage")
local ToolFolder = ServerStorage:WaitForChild("BadgeRewards")
local ToolToBadgeList = {
BackroomsPoster = 12345678, -- put the actual badge id here
-- and so on for each of your tools
}
local function giveToolsForBadges(player)
for toolName, badgeId in pairs(ToolToBadgeList) do
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, badgeId)
end)
if success and hasBadge then
local tool = ToolFolder:FindFirstChild(toolName)
if tool and not player.Backpack:FindFirstChild(toolName) then
tool:Clone().Parent = player.Backpack
end
end
end
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
giveToolsForBadges(player)
end)
end)
Learn scripting please it will make your life easier by a ton also, you won’t be able to make a good game without you knowing how to script
at least learn the basics