Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do i make team weapons?

i tried scriptting but they dont work.

2 answers

I've heard rumors that all you have to do is put the tools in the Team you want. I've never tested it, however.

If that doesn't work, then you can put them into Lighting/ReplicatedStorage/ServerStorage and have a script look through the player's TeamColor and see what it can give them.

Here's how you can do this:

red = {"A table with a bunch of ", "weapon names", "that you want ", "for the red team"}
blue = {"Same thing"}

game.Players.PlayerAdded:connect (function (player) -- triggers when a player enters the game. See link 1
	player.CharacterAdded:connect (function (char) -- triggers when a character spawns. See link 2
		if-- statement checking for team color. Let's just say it's blue
			then 
			for i,weapons in pairs (blue) do -- takes every item from the table and processes them. See link 3
				if game.Lighting[weapons] then -- if there's a weapon in the lighting with the name of the weapon then
					game.Lighting[weapons]:Clone ().Parent = player.Backpack -- the player parameter from the .PlayerAdded event
				end
			end
		end
	end)
end)

Link 1 Link 2 Link 3

This discussion is preserved as it was. New answers, comments, and votes are closed.