#Help me with a plot system

1 messages · Page 1 of 1 (latest)

vocal bay
#

local plots = {game.Workspace.Plots.CurrentPlots:GetChildren()}
game.Players.PlayerAdded:Connect(function(plr)
    
for _, plot in plots do
 if plot:FindFirstChild("Owner") and plot.Owner.Value == "None" then
   plot.Owner.Value = plr.Name
   print(plot.Name.. "has been assigned to Player:" ..plr.Name)      
        end
    end
end)```
worthy tundra
#

uh

#

just so you know
:GetChildren() returns an array of all objects inside of a parent

#

{Part1, Part2, Part3, Part4} -- {Plot1, Plot2, Plot3, Plot4, Plot5, ...}

#

so you don't need curly brackets for :GetChildren()

#

cuz its already a table

#

@vocal bay

frail quartz
#

this is missing a break , without break a player can take multiple plots

worthy tundra
#

i forgot about this

frail quartz
#

also plot list is not updating , so if there is any plots removed or added in runtime , list will not know

#

also there is no handle if plots are full or not

worthy tundra
#

if its not "None" then its full

frail quartz
#

plot.Owner.Value = plr.Name
print(plot.Name.. "has been assigned to Player:" ..plr.Name)
break

like this you can add a break

worthy tundra
#

script runs once you join

#

1 time

frail quartz
#

thats what i meant with handle

worthy tundra
plucky crystalBOT
#

studio** You are now Level 4! **studio

worthy tundra
#

oh

frail quartz
worthy tundra
#

wait

#

you mean if it doesn't find available plot then it will kick you?

#

or wut

frail quartz
#

im not really sure what his game is but yes

#

no plots = kick

worthy tundra
#

i think he has 6 players cap

#

im pretty sure he does

frail quartz
#

well maybe each plot has its own name , and someone is trying to take an plot that is already taken or searching for it

worthy tundra
#

but ofc you can create a variable

frail quartz
#

i came here looking for a builder but i guess i will just keep my ideas for me

#

i hate desigining and building i swear

worthy tundra
#

idk how to build shit 😭

frail quartz
#

for real its hard

worthy tundra
#

i cant even build simple tool or smth

frail quartz
#

i cant build a damn plot but i can script a whole game

worthy tundra
#

fr

frail quartz
#

my ideas are simple and stupid but cant find a guy that can build them

#

its a tycoon

#

easiest shit

worthy tundra
#

i mean

#

its kinda working but data saving is poor

#

i even used object pooling 😎

frail quartz
#

i tried many times and i failed many times cause i aint a builder

#

i need to catch a nice builder to help me

worthy tundra
frail quartz
#

oh damn looks nice

worthy tundra
#

my best build ig 😭

frail quartz
#

its good enough

worthy tundra
#

i think i quit this project cuz of saving

#

or assigning tycoons

frail quartz
#

dammit i cant even make that sadly

worthy tundra
#

nvm

#

its bad

vocal bay
#

so far going ok