I'm trying to make it so if you're on the team Criminal and you have the items Taser or HandCuffs in your backpack, it gets removed. I tried doing this but it didn't work.
local players = game:GetService("Players")
local criminals = game.Teams.Criminal
players.PlayerAdded:Connect(function(player)
player.Team = criminals
player.CharacterAdded:Connect(function(character)
character.Humanoid.Died:Connect(function()
if player.Team == criminals then
while true do
game.Players.LocalPlayer.Backpack.Taser:Destroy()
game.Players.LocalPlayer.Backpack.HandCuffs:Destroy()
end
end
end)
end)
end)

2 comments
Didn't make any blue or red underlines in script, I changed my players Team intvalue value to Criminal and I was also on Criminal team, no messages in output but it doesn't work for some reason
Odd, It worked fine for me when I tested it, my Taser and Handcuffs got removed as soon as I change the Value to Criminal.. Did you put the lines of code in a Local Script?