#when ppl join how do u make it with their own plot/base when they join
1 messages · Page 1 of 1 (latest)
Is this completely from scratch
nope i have some bases already ready
well the scripting yeah is from scratch mb @hardy socket
Theres probably a better way of optimising but this is what I came up with
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?
make a script in serverscriptservice
and put it in that
oh alr
also I would suggest you watch scripting tutorials