#when ppl join how do u make it with their own plot/base when they join

1 messages · Page 1 of 1 (latest)

lilac finch
#

so when people join the game, how do u make it so that they have their own plot/base accordingly

hardy socket
#

Is this completely from scratch

lilac finch
#

nope i have some bases already ready

#

well the scripting yeah is from scratch mb @hardy socket

hardy socket
#
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")

Players.PlayerAdded:Connect(function(plr)
    local P1Players = Teams.Plot1:GetPlayers()
    local P2Players = Teams.Plot2:GetPlayers()
    local P3Players = Teams.Plot3:GetPlayers()
    local P4Players = Teams.Plot4:GetPlayers()

    if #P1Players == 0 then
        plr.Team = Teams.Plot1
        elseif #P2Players == 0 then
        plr.Team = Teams.Plot2
        elseif #P3Players == 0 then
            plr.Team = Teams.Plot3
        elseif #P4Players == 0 then
            plr.Team = Teams.Plot4
    end
end)```
#

the # I put infront of it just means the number of players

#

it basically turns a table into a number depending of how much things are in the table

#

@lilac finch does it work?

lilac finch
#

damn alr give me a sec

#

do i just copy and paste into the cmd bar?

hardy socket
#

and put it in that

lilac finch
#

oh alr

hardy socket
#

also I would suggest you watch scripting tutorials

lilac finch
#

thx for tryin to help i’m tryna learn how to script

#

yeah yeah