I have tried many things just to put a self-made weapon in 1 team. Please help me how I can do that. And I know I can just put it in the starterpack but I want only 1 team having it.
COMMUNITY QUESTION
How can you add your created tools in a team?
1 answer
It's not quite as simple as putting it in the starter pack. You will need to check what team the player is on when their character respawns, then put the tool in their Backpack if they are in the correct team.
local team = game.Teams["TeamName"] -- the team that you want to get the tool
local tool = -- (wherever your tool is, I'd recommend putting it in the ServerStorage)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character) -- backpack clears when player respawns
if player.Team == team then
local toolClone = tool:Clone()
toolClone.Parent = player.Backpack
end
end
end
This is a really rough script just to demonstrate the concept so don't expect it to work perfectly, of course.
This discussion is preserved as it was. New answers, comments, and votes are closed.
