#Lobby system

1 messages · Page 1 of 1 (latest)

fathom idol
#

I’m trying to make a lobby system and it doesn’t seem to work

#

I don’t know what I’m doing

whole acorn
#

Lobby system can be a little complicated

Game state manager/module

It says when the players are for example

Voting
Intermission (buying upgrades waiting joining etc)
Playing

Then in your scripts you can refere to what state the game is currently in

#

I spawn an NPC when it's intermission time
Then destroy him when voting starts

I turn on the voting buttons when voting starts

#

So I highly recommend implementing a game state module

#

What specifically are you battling with

oblique oasis
fathom idol
#

I will try my best to figure it out

oblique oasis
#

The common approach you see are party games. These games typically have ~ 3 states for their lobby.

  • Intermission
  • Voting
  • Loading
#

And other lobby systems, such as TDS or Doors uses a elevator or ui apporach where you can create party's/rooms to add people into the game and teleport them to a different place

#

This system isn't complete black and white so some information would be needed on what you plan to make

#

@fathom idol What type of lobby system are you planning to make?

fathom idol
#

A lobby system that just takes you to a game

#

It will be pre coded and don’t matter if it’s with 1-4 people

#

It will be the same

oblique oasis
#

Ok so something similar to doors?

fathom idol
#

Yes

#

A pre coded game

oblique oasis
#

Ok so you want to make more of a party/room system

fathom idol
#

I guess

oblique oasis
#

so a party of people can be sent to a game at once bvasically

fathom idol
#

Yes

#

That’s where I keep having problems

oblique oasis
#

you sound really new so let me think of a simple approach you can do to make this system

#

But correct me if I'm wrong

fathom idol
#

Ok

#

I’ve been coding for a couple weeks and can’t seem to make progress

oblique oasis
#

Do you want elevators (or something similar) or ui party

fathom idol
#

Just a lobby where you walk into the wall and it teleports you into a box

oblique oasis
leaden ibexBOT
#

studio** You are now Level 1! **studio

fathom idol
#

If you want I can send a picture of what my lobby goal is

whole acorn
#

I'll be honest I think you should just mess around with an easier version first

You are jumping the gun with a lobby system, you could improve faster working on basics

For my lobby system it just loops through intermission voting and playing by waiting time out rather than a whole lobby doors setup

fathom idol
#

And what it so far looks like

oblique oasis
fathom idol
whole acorn
oblique oasis
#

@fathom idol get proficient at arrays and dictionaries

fathom idol
#

Kinda like doors lobby it takes you right to the game

oblique oasis
#

Here is a good way I thought of to make a elevator type lobby system

Each elevator will contain a list of all active player's inside
-> if elevator is empty, do nothing
-> if a player collided with a hitbox within the elevator, add them within the list
-> start a timer
-> if the max amount of players join elevator, make the timer 5 seconds

#

Very simplkistic but that is the simplest way I thought of making one

whole acorn
#

Won't that require a spatial query?

oblique oasis
#

He can do a simple .Touchded event

fathom idol
#

Can I show you what I’ve got so far. I don’t know what I’m doing but I’m following a totorial

#

Tutorial*

fathom idol
oblique oasis
#

bro what the hell is this

fathom idol
#

Idk

oblique oasis
#

win+shift+s for screenshot 😭

fathom idol
#

I can’t

oblique oasis
#

why'

fathom idol
#

My internet trash and discord take hours to load

#

I also have bad pc

oblique oasis
whole acorn
#

I imagine the floors have touched events

#

Using a string value for a timer for some reason

fathom idol
#

That’s it

#

And a folder with nothing in it

whole acorn
#

You don't have a script using the floor?

oblique oasis
#

no scripts?

fathom idol
#

The only script I know is how to press a button

#

It’s pointless I’m just going to give up

leaden ibexBOT
#

studio** You are now Level 2! **studio

oblique oasis
fathom idol
#

It’s just too confusing for me

whole acorn
#

refere the floortouch parts
ill use Duo as an example

local Players = game:GetService("Players")

local playersList = {}
local DuoFloor = workspace.Duo:WaitForChild("DuoTouchPart")

DuoFloor.Touched:Connect(function(hit)
    local character = hit.Parent
    local player = Players:GetPlayerFromCharacter(character)
    if player and not table.find(playersList, player) then
        table.insert(playersList, player)
        print(player.Name .. " touched DuoFloor!")
    end
end)
oblique oasis
#

You don't learn how to code in a few weeks

whole acorn
#

youve completely skipped the basics lol

oblique oasis
#

It takes time

fathom idol
#

Ok

#

How can I learn to code?

#

Like make a simple game?

timber ermine
#

ye

#

also learn the basics plz

#

like on yt

#

playlists

#

brawldev

fathom idol
timber ermine
#

thats how i learned

#

i started a month ago

fathom idol
#

Is a part that follows you and will kill uou if it touches you, that has pathfindiny hard but will go the opposite direction to of you and go to the nearest player hard?

#

Like cheese escape

whole acorn
#

https://www.youtube.com/watch?v=evBhoqeYegQ&t=138s&ab_channel=MonzterDEV
this is exactly what i did

i followed this youtube video using a external module called "profile store"
then you can start saving player data

make a simple game

place balls in a folder around the workspace

make a server script and have it so when you touch a ball it adds the ball to your data
so player.balls = 1

thats how i started

fathom idol
#

But with a part?

timber ermine
#

the pathfinding hard

#

but killblock easy and follow easy

#

for me tho

fathom idol
#

I can manage with a kill script

timber ermine
#

the pathfinding, maybe u can find a module for that

whole acorn
#

there is little to no point jumping to pathfinding icl

leaden ibexBOT
#

studio** You are now Level 23! **studio

whole acorn
#

its the small things he needs

timber ermine
#

ye

fathom idol
#

Ok

#

Is a gun easy

whole acorn
#

no

fathom idol
#

Like a simple one

whole acorn
#

combat or guns is hard

timber ermine
#

u have to understand

#

raycast

#

and

#

velocity

fathom idol
#

Click and part moves then kills?

timber ermine
#

physics

fathom idol
#

That hard?

whole acorn
#

thats not how guns work in roblox

timber ermine
#

its not those topics thats hard

fathom idol
#

Ok

timber ermine
#

but you have to use general logic

#

for that

whole acorn
#

if you do the ball game i will dm and help you through it

timber ermine
#

once you learn the basics

#

you can think of solutions

#

for anytihng

oblique oasis
#
--// Services \\--
local Players = game:GetService("Players")

--// Settings \\--
local MAX_PLAYERS = 4
local TIMER = 30
local MAX_PARTY_TIMER = 5

--// Stuff \\--
local Party = {}
local Timer = 30

--// Elevator Stuff \\--
local ElevatorHitBox = ...

--// Private Functions \\--

local function isPlayerInLobby(Player): boolean
    --I dont want to do this rn, but pretends it returns a bool
    return false
end

--// Signals \\--
ElevatorHitBox.Touched:Connect(function(TouchedPart)
    if not TouchedPart.Parent:FindFirstChild("Humanoid") then return end
    if isPlayerInLobby(Players:GetPlayerFromCharacter(TouchedPart.Parent)) then return end
  
    --Inefficient to do find the player from character twice
    table.insert(Party, isPlayerInLobby(Players:GetPlayerFromCharacter(TouchedPart.Parent)))

    --Check if the player leaves the games to remove them from the list
end)

while true do
    task.wait(1)
    if #Party == 0 then continue end
    Timer -= 1

    --Lazy to do logic

end
fathom idol
whole acorn
#

BST

oblique oasis
timber ermine
oblique oasis
#

But if u learn the basics you should understand this

fathom idol
#

At night

whole acorn
#

it is 2:38am 😭

fathom idol
#

Oh

whole acorn
#

you can absolutly understand this devo with some time

fathom idol
#

It 9:38at night

#

K

#

Can we do this in 20 hours?

#

I got to sleep

whole acorn
#

yeah dw watch the video i sent when you have some spare time
it will teach you how to setup what you need then from there i can help