So I'm making this boss fight game, and there's this script that is supposed to give the players their weapons depending on the badges they have.
game.Players.PlayerAdded:connect (function(Player)
local Badge = game:GetService('BadgeService')
local Weapons = game.ReplicatedStorage:WaitForChild("Weapons")
if Badge:UserHasBadge(Player.userId, 543912061) then
Weapons.Lewis:Clone().Parent = Player.Backpack
Weapons.Lewis:Clone().Parent = Player.StarterGear
end
if Badge:UserHasBadge(Player.userId, 648868230) then
Weapons.Spoon:Clone().Parent = Player.Backpack
Weapons.Spoon:Clone().Parent = Player.StarterGear
end
if Badge:UserHasBadge(Player.userId, 654113969) then
Weapons.Radon:Clone().Parent = Player.Backpack
Weapons.Radon:Clone().Parent = Player.StarterGear
end
if Badge:UserHasBadge(Player.userId, 660341744) then
Weapons.Polearm:Clone().Parent = Player.Backpack
Weapons.Polearm:Clone().Parent = Player.StarterGear
end
end)
However, according to several reports, the script does not work when the user rejoins the server.
I have attempted to make a GUI that gives the tools, but unfortunately it cannot query for badges for some odd reason.
How would I fix this so that it would always give the player their tools when they joined?

1 comment
Had to edit it a little but it works now! Thanks!