I have this badge that gives the player the Teddy Bloxpin gear, but they have to rejoin to get it. How do I make it so they get the gear as soon as they get the badge, and keep it if they die?
ServerScriptService:
local mps = game:GetService("BadgeService") local badge_id = 2127257301 game.Players.PlayerAdded:Connect(function(player) if mps:UserHasBadgeAsync(player.userId, badge_id) then game.ServerStorage.TeddyBloxpin:Clone().Parent = player:WaitForChild("Backpack") game.ServerStorage.TeddyBloxpin:Clone().Parent = player:WaitForChild("StarterGear") end end) game.ReplicatedStorage.TeddyBloxpin.OnServerEvent:connect(function(player) game.ServerStorage.TeddyBloxpin:Clone().Parent = player:WaitForChild("Backpack") game.ServerStorage.TeddyBloxpin:Clone().Parent = player:WaitForChild("StarterGear") end)
Gives Badge:
local badgeservice = game:GetService("BadgeService") local id = (2127257301) script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) badgeservice:AwardBadge(plr.UserId, id) end end) local mps = game:GetService("BadgeService") script.Parent.Touched:connect(function(plr) local player = game.Players.LocalPlayer end)
Just give the player the tool when you give the badge:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) badgeservice:AwardBadge(plr.UserId, id) game.ServerStorage.TeddyBloxpin:Clone().Parent = player.Backpack game.ServerStorage.TeddyBloxpin:Clone().Parent = player.StarterGear end end)