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
10 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..

1function 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 10 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()

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

Answer this question