Hi, Im trying to make a roblox game that has different modes, when a player starts the game, I want a menu to pop up and they select a game mode, this will then create a new server based on the gamemode selected, how should i go about doing this (i know how to make the gui, its the server creation im struggling with)
COMMUNITY QUESTION
How do I made a gamemode selection screen?
1 answer
If your game is FilteringEnabled, use a RemoteEvent. I don't know the layout you want it to be like. Let's say you have a frame holding all the TextButtons that the player is to press, we'll have to create a remoteevent.
--Server Code
local re = game.ReplicatedStorage.RemoteEvent
local gamemode
re.OnServerEvent:Connect(function(player,txt)
gamemode = txt
print(txt)
end)
--Client Code
local gmbuttonframe = script.Parent
local re = game.ReplicatedStorage.RemoteEvent
for _,v in pairs(gmbuttonframe:GetChildren()) do
if v:IsA('TextButton') then
v.MouseButton1Down:Connect(function()
re:FireServer(v.Text)
end)
end
end
Everytime, you click a button on the frame, the server sets the 'gamemode' variable to the text of the button clicked. If the player pressed a button that's text is 'Free - For - All', the server will print 'Free - For - All' in the output.
My roblox profile : https://www.roblox.com/users/273093957/profile
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Will this create a new server for them to join or will it change the existing server into that gamemode?
the code will change the existing server into that gamemode
on line 7 it should be if v.ClassName == "TextButton"
it's 'className', but you can use IsA. It's a function of all instances.