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

Group Only Spawn?

Asked by 8 years ago

I have a place for a group and i would like Group only spawns. What script should i use? or what do i need to have to scripting that? i am new to all of this so plz help. What do i need to do for this kinda script?

3 answers

Log in to vote
3
Answered by 8 years ago

To do this, you would need two spawns. One cannot have an AutoAssignable team. Then, you would want to use the PlayerAdded event and use :IsInGroup(Group Id) to see if that player is in the group. If the player is not in the group, leave them in that original spawn, however, if the player is in that group, then you would change their TeamColor to the group team's color.

I have not given scripts or anything due to your question not actually asking for that. Also, if you were to ask for a script, I am sure you would be breaking the rule of requesting people to make you scripts.

0
You beat me to it :P Upvoted dyler3 1510 — 8y
Ad
Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
8 years ago

Go ahead and accept alphawolvess answer, I'm just here for extra support. If you're trying to find the GroupId, you need to go the groups page, and take the Id from the website. An example can be found here.


Also, just so you know exactly what he's talking about, here is an example script:

local Id=2597152
game.Players.PlayerAdded:connect(function(Plr)
    if Plr:IsInGroup(Id) then
        Plr.TeamColor=BrickColor.new("Bright red")
    else
        Plr.TeamColor=BrickColor.new("Bright blue") 
    end
end)
Remember, don't just use other peoples code. Try to understand it, and make it your own so you can learn better.

Anyways, if this helped, I'd appreciate an upvote. If you have any further problems/questions, please leave a comment below. Hope I helped :P

-Dyler3

0
Srsly, signing your name lol. Mr Famous over here <3 Jk, no harm done ^.^ alphawolvess 1784 — 8y
Log in to vote
1
Answered by 8 years ago

A script to do this would be...

local Id=[GroupID]
game.Players.PlayerAdded:connect(function(Plr)
    if Plr:IsInGroup(Id) then
        Plr.TeamColor=BrickColor.new("[Team it puts group players on")
    else
        Plr.TeamColor=BrickColor.new("[Team it puts non-group players on]") 
    end
end)

Change the [GroupID] to the ID of the group (See the address bar). [Team it puts group players on] and [Team it puts non-group players on] should be team colors, E.g. Bright Blue and New Yeller instead of the brackets and whats inside.

Feel free to modify it.

Answer this question