Sorry about how I worded the question, I don't know how else to explain. I'm having a hard time with this. So, when the player is added it works but, this is only a one time deal. If the player dies it doesn't work again. I'm wondering how I would change it from PlayerAdded to CharacterAdded? I've been having a hard time with this. If the player has the badge then, clone the tool into the backpack.
This works for a one time PlayerAdded.
local BadgeService = game:GetService("BadgeService") local BadgeId = 2124743307 local replicatedstorage = game:GetService("ReplicatedStorage") local tool = replicatedstorage:FindFirstChild("Lucifer") game:GetService("Players").PlayerAdded:Connect(function(player) if BadgeService:UserHasBadge(player.UserId, BadgeId) then tool:Clone().Parent = player:WaitForChild("Backpack") else print("The user does not have this badge") end end)
This does not work.
local BadgeService = game:GetService("BadgeService") local BadgeId = 2124743307 local replicatedstorage = game:GetService("ReplicatedStorage") local tool = replicatedstorage:FindFirstChild("Lucifer") game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) if BadgeService:UserHasBadge(player.UserId, BadgeId) then tool:Clone().Parent = player:WaitForChild("Backpack") else print("The user does not have this badge") end end) end)
Thank you for the help in advance, I appreciate it! I'm just here to learn.