Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

how do i make team weapons?

Asked by 10 years ago

i tried scriptting but they dont work.

2 answers

Log in to vote
0
Answered by
Maxomega3 106
10 years ago

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

Ad
Log in to vote
0
Answered by 10 years ago

THIS IS A DUPLICATE

Answer this question