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

A well made auto-team script?

Asked by
wddd89 35
9 years ago

(credit to Collin201)

I'm trying to develop a script in which it automatically puts you onto a team if you're in a group (like in most war group bases). This is a fairly acceptable concept, but I'm sure it needs to be worked on and it probably won't function correctly..

 function onPlayerEntered() ifPlayer IsInGroup(2531656) then game.Workspace.LocalPlayer.TeamColor = BrickColor.new ("Dark stone grey")

Any tips? Revisions to the script? Either way it'll be appreciated. Thanks.

1 answer

Log in to vote
1
Answered by 9 years ago

First off, you're missing "end" to your code blocks. Also, the team arranger thing should be checked from a server script. Not a local one. And IsInGroup() is a method of Player, so you have to add a colon between Player and IsinGroup()

--Inside a server script
game.Players.PlayerAdded:connect(       --Connect the PlayerAdded event from player to an anonymous function
    function(plr)
        if plr:IsInGroup(GROUPID) then --If the player is in a group with this ID then
            plr.TeamColor = BrickColor.new(BRICKCOLOR) --Put them in this team
        end
    end
)
0
Sorry for the late response. Thank you so much. wddd89 35 — 9y
Ad

Answer this question