I have a script that checks if a player owns a badge, but I don't know how to make it award the tool. If you could help, that would help a lot.
local BadgeService = game:GetService("BadgeService") local BadgeId = 0000 --Your badge Id here if BadgeService:UserHasBadgeAsync(game.Players.LocalPlayer.UserId, BadgeID) then end
You can use a PlayerAddedEvent which fires whenever the player joins and a characterAdded Event which does the same But for the Player's character ( fires whenever the character respawns/spawn )
local BadgeTool = -- The Tool local BadgeID = --- BadgeID game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAdded:Connect(function(Character) if BadgeService:UserHasBadgeAsync(Player.UserId, BadgeID) then local PlayersBackpack = Player:WaitForChild("Backpack") local ClonedTool = BadgeTool:Clone() ClonedTool.Parent = PlayersBackpack end end) end)
You could do tool:Clone().Parent = player.Backpack
.
(Also, you can't use local player in a server script, so ill just use a player added event)
Server script:
local BadgeService = game:GetService("BadgeService") local BadgeId = 0000 --Your badge Id here local tool -- tool here game.Players.PlayerAdded:Connect( function(plr) plr.CharacterAdded:Connect( function(Character) if BadgeService:UserHasBadgeAsync(plr.UserId, BadgeID) then tool:Clone().Parent = plr.Backpack end end ) end )