본문 바로가기

Roblox Script

#11 : 그룹에 따라 팀 나누기 (Team by Group)

속한 그룹에 따라 팀을 나누고, 스폰포인트를 나누는 예제입니다.

local function playerJoin(player)   
    if player:IsInGroup(42) then
       
print "Player is in the Roblox Building Group"
        print ("Then,"..player.name.." is Theif Team")
        player.Team = game.Teams.Theif
    else
        print "I'm Not Building Group"
        player.Team = game.Teams.Police
    end
end

game.Players.PlayerAdded:Connect(playerJoin)