How to Make a Simulator on Roblox in 2022!
Summary
TLDRIn this video series, you'll learn how to create a modern simulator in Roblox. Building on a previous 30-episode series, the creator has incorporated extensive feedback to improve both teaching methods and code quality. The course covers developing a clicker simulator and includes a community Discord for support. The first episode focuses on setting up player data using the Profile Service module, organizing scripts, and ensuring efficient data management. Viewers are encouraged to provide feedback and join the Patreon for access to scripts and game files.
Takeaways
- 😀 The video series aims to teach viewers how to create a modern simulator in Roblox.
- 📚 The creator has improved their video content and coding based on past feedback and criticism.
- 🔍 The series will cover various topics with potential additions based on viewer feedback.
- 🗂️ A community Discord is available for viewers to ask questions and get help with issues.
- 💻 The creator uses the Profile Service module for managing player data in a new and efficient way.
- 📁 The Profile Service module is added to the Roblox workspace through the Roblox website.
- 📝 Two folders, 'player data' and 'libs', are created in the server script service for organization.
- 💬 The 'template' script sets default player data such as clicks and gems, starting at zero for each player.
- 🔑 The 'manage' script is used to access and store player profiles in a table for easy data retrieval.
- 🔄 The 'data' script handles the loading and unloading of player data when they join or leave the game.
- 📊 Leader stats are set up for player progress tracking, displaying clicks and gems earned.
Q & A
What is the main goal of the video series?
-The main goal of the video series is to teach viewers how to create a modern simulator in Roblox, with the aim of making it one of the best series on YouTube for developing a game on Roblox.
What is the purpose of the Discord community mentioned in the video?
-The Discord community serves as a platform for viewers to ask questions and get help from others who may have encountered the same issues while following the tutorial.
What is the role of the 'profile service module' in managing player data?
-The 'profile service module' is used to manage player data in an organized and efficient way, allowing developers to easily access and manipulate player profiles within their game.
How does the video series handle the issue of player data management from the previous series?
-The video series introduces a new and improved method of managing player data using the profile service module, which is considered a better and easier way compared to the previous approach.
What are the two types of currencies typically found in Roblox simulators?
-The two types of currencies typically found in Roblox simulators are 'clicks' and 'gems', which are used as part of the game's economy and progression system.
How does the video guide the viewer in setting up the player data structure?
-The video guides the viewer through creating a 'template' module script that defines the default data for each player, such as clicks and gems, and then setting up a 'manager' script to handle the loading and accessing of player profiles.
What is the purpose of the 'libs' folder in the server script service?
-The 'libs' folder is used to store libraries or modules that are not created by the developer themselves but are used within the game to perform certain functions or tasks.
How does the video address the feedback on font size from previous videos?
-The video acknowledges the feedback on font size and increases the font size for better readability, inviting viewers to comment if the new size is suitable or if adjustments are needed.
What is the function of the 'load profile' function in the script?
-The 'load profile' function is responsible for loading a player's profile when they join the game, checking if the profile exists, and if not, it kicks the player with a predefined message.
How does the video handle the saving and loading of player data?
-The video explains that player data is saved and loaded using the profile service, and it mentions that enabling Studio access to API Services in game settings is necessary for data to be saved properly.
What additional feature is added to the player data setup in the video?
-The video adds leader stats to the player data setup, which allows for tracking and displaying player progress in clicks and gems currencies.
Outlines
📚 Introduction to Modern Simulator Series in Roblox
The video script introduces a series focused on creating a modern simulator in Roblox. The instructor acknowledges previous work and feedback received, expressing a commitment to improving the teaching approach and code quality. The series aims to be one of the best on YouTube for developing Roblox games. The instructor outlines the topics to be covered and invites viewers to provide feedback for additional topics. A community Discord is highlighted for support, and a Patreon link is provided for those interested in accessing scripts, game files, and other resources. The video then jumps into Roblox Studio, where the instructor begins by setting up player data using a new method involving the Profile Service module, emphasizing its simplicity and effectiveness.
🛠 Setting Up Player Data with Profile Service Module
This paragraph delves into the technical process of setting up player data in Roblox using the Profile Service module. The instructor guides viewers through organizing their workspace with specific folders for player data and libraries. The Profile Service is obtained from the Roblox website and added to the workspace. The script then explains how to create a template for player data, including default values for two in-game currencies: clicks and gems. A 'manage' module script is created to handle player data access, and a 'data' script is set up to manage player joins and data loading/unloading. The importance of using a consistent key for data storage is emphasized to avoid data loss. The script also addresses viewer feedback on font size, aiming to enhance readability.
🔢 Implementing Leader Stats and Finalizing Player Data Setup
The final paragraph of the script covers the creation of leader stats for the game, which involves setting up数值values for player clicks and gems. The instructor demonstrates how to create these stats as part of the player's profile and ensure they are correctly linked to the player's data. The script includes a function to create leader stats, which is called after the player's profile is set in the manager table. The video concludes with testing the setup in Roblox Studio, noting that while the Profile Service API is unavailable in Studio, the data will be saved when the game is published. The instructor encourages viewers to like, subscribe, and turn on post notifications for more content, and mentions a Patreon for additional scripts and files.
Mindmap
Keywords
💡Roblox
💡Simulator
💡Profile Service Module
💡Player Data
💡Module Script
💡Libraries
💡Leader Stats
💡Studio Access
💡Discord
💡Template
💡Data Store
Highlights
Introduction to creating a modern simulator in Roblox, with an emphasis on improving video and code quality based on feedback.
Course overview provided, with topics to be expanded based on viewer feedback.
Invitation to join a community Discord for support and discussion on issues encountered during tutorials.
Introduction of a Patreon page offering additional resources such as scripts, game files, and models.
Explanation of the new approach to managing player data using the Profile Service module.
Demonstration of how to access and utilize the Profile Service module from the Roblox website.
Organization of workspace with folders for player data and libraries for better script management.
Creation of a template script defining player data structure with initial currency values set to zero.
Introduction of the 'manage' script for accessing and requiring player data in other scripts.
Setup of a 'data' script for handling player join and leave events, and managing data load and unload.
Implementation of a function to load a player's profile using the Profile Service store.
Use of type checking for better auto-completion and understanding of variable types in Roblox.
Handling of data issues by kicking players with a predefined message if their profile fails to load.
Reconciliation of player profiles with a template to ensure all necessary data is present.
Automatic addition of player profiles to a manager table for easy access in other scripts.
Setup of player data removal from the manager table upon player leaving to prevent data leaks.
Creation of leader stats for player currencies and linking them to the player's profile data.
Testing of the player data system in Roblox Studio and troubleshooting with API Services.
Conclusion summarizing the completion of working player data setup with plans for further expansion in future episodes.
Transcripts
by the end of the series you'll know how
to create a modern simulator in Roblox
I've already
on this topic before how to create a
simulator in Roblox Studio which
expanded over 30 episodes through that
series I took an immense amount of
feedback and criticism on how I can
improve my videos for teaching you guys
as well as improving my own code while
working on countless other projects
during the same time so my anticipation
is to make this series one of the best
on YouTube on how to actually begin
developing your own game on Roblox and
hopefully by the end of the series you
guys can let me know how I did in this
series we'll be creating our own version
of the clicker simulator by pressure
Studios on screen right now is a sort of
course overview where you can see all
the different topics that we'll be
covering in this series well going
through the series will most likely add
even more topics to this as well and
I'll certainly be looking at the
comments to get feedback from you guys
to see what you also want me to add to
this as well now I'd also like to
highlight our Discord we have a
community Discord where a lot of people
just like yourself who are watching all
of my other tutorials come in and ask
questions so if you're having an issue
while watching a video join the Discord
and most likely there will be somebody
who has the exact same issue as you that
already posted this in the Discord so
you can easily get help and one last
thing I have a page on you guys like to
support me and gain access to all the
script and the game file and models and
other things like that that I make
during my videos there's a link Down
Below in the description and you guys
can go and check that out with all that
being said let's hop directly into
studio now inside of my studio you guys
can see inside of my workspace I already
have a little map keep in mind if you
want to access the map you can get it
from the patreon but otherwise this map
doesn't actually matter it's all just
for Aesthetics and visuals and it's not
going to have any effect on our
scripting or anything like that with
that being said what we're going to do
for the first episode is start tripping
out our player data now my previous
series the way that I did player data
was horrible so with this brand new
series I'm really happy to start
introducing you guys to the best and
easiest way that you can actually manage
your own players data it's super super
simple what we're going to be using to
manage our player data is actually
called a module or a library and the
specific one that we're going to be
using is the profile service module if
you like to access this there's a link
Down Below in the description to this
page which you guys can go to what
you're going to want to do though is
you're going to want to get the library
model by going onto the Roblox website
right here and clicking the get button
now once you've done that you should be
able to access it from your toolbox May
maybe in your recent models or other
things like that then just go ahead and
click on that and it should add it
directly into your workspace to keep
everything organized the next thing
we're going to do is we're going to go
into the server script service and add a
brand new folder and we're going to
rename this to player data additionally
we're going to create another folder
inside of the server script service and
we're going to rename this to lips
l-i-b-s Libs is short for libraries and
a lot of other coding languages when
you're basically using somebody else's
code to do something for you that's
usually referred to as a library in luo
or the Roblox Community we commonly
refer to libraries as modules or other
names like that personally I call them
libraries so that's why I make a folder
either in my server script service or
replicated storage called lib so that I
know this is where all the things that I
didn't create myself and this is where
all the libraries exist in my game so
we're going to put the profile service
inside of that folder and now we're done
with that module we're never actually
going to touch that module what we're
then going to do is actually start
setting up our player data the first
thing we need to do is we actually need
to insert a module script inside of the
player data folder and we're actually
going to rename this to template then we
could also rename the variable as well
from module 2 template just like that
now what template's actually going to be
set to it's going to be set to a table
with all the data that each player
should have this might sound confusing
don't worry just keep following along
with me and you should be able to get it
by the end of this episode if you use
leader stats in any of your game you can
also think of those as your player data
as well now pretty much every single
simulator in the entire Roblox world has
at least one commonality and that is
that they always have two different
currencies so for clicking simulator
they have clicks and we're going to set
the default value of that to zero so
when a player joins our game they're
going to start off by having zero clicks
and the other currency that we're gonna
have in our game is called gems and
we're also going to set that to zero as
well now if we set this to 100 then when
a player first joins our game they will
start off with a hundred gems but we
want to start them off with zero now
that's all we're going to do for the
template so far because we're not going
to do too much in this episode but every
single episode where we actually start
to add more and more player data all we
have to do is come back to this table
right here and add it to it and it is
extremely simple you're gonna love it
the next thing we need to do is we need
to go back inside of the player data
folder and add another module script and
this is actually going to be called the
manage because this is the module script
that we're going to require in our other
scripts if we ever want to access a
player's data so we can also rename the
variables as well to manager and now
inside of here all we're going to do is
actually create another variable and
we're going to say manager dot profiles
equals and then a blank table the way
that the profile service basically works
is that every single player gets their
own profile which holds all of their
data so whenever we generate the
player's profile we're going to store it
in this table right here so that we can
go into other scripts and access this
profile and get the player's data now
that's all that we're going to do with
this script for now the next thing we're
going to do is we're going to create a
script inside of the player data folder
and we're going to rename this to data
inside of here we're going to basically
script up the entire system for whenever
a player joins the game or leaves the
game and load their data and unload
their data when it should be also one
comment I always got on my other videos
was to increase my font size I'm not
sure why it wasn't increased before
because I thought it should have been
but it seemed like it reset but I just
increased it again so please let me know
in the comment section if this size is
good for you or if you need it to be a
little bit larger anyway let's start
declaring some variables up here so
local players and we're going to get the
player's service us we're also going to
want to get the server script Service as
well now that we've gone both of those
Services we then need to get the
template and the manager module so we're
going to say local template equals
require servicecript
service.playerdata.template and then to
get the manager we can just duplicate
that variable and then just rename it
just like that we also need to get the
profile servers as well so I'm just
going to duplicate this once again then
from the server script service we're
going to go into the libs folder and get
the profile service just like that and
then we just got to rename the variable
and now that's all good the next thing
we need to do is create a specific store
for the profiles so we're going to
create a variable called profile store
and we're going to set that equal to the
profileservice.getprofile store now the
first argument we need to pass through
to this is a specific key if you guys
have ever used data stores before you
need to do a similar thing where you
basically come up with your own kick now
for all my games when I go into
production or release a brand new update
the store is always production now if
this key is different like let's say for
instance we just started up our game and
it was with production and then we
changed it to five it would actually
reset all of our data because we just
changed the store that we're listening
too so if I start this with six all of
our data will be wiped but if I put it
back to production all the data that was
already in production will be used once
again so basically while I'm testing
I'll usually use the test profile store
and then when I go to production or push
on update I'll always make sure that I
put that to production so that the
players always have their same exact
data that second argument that we need
to pass through to here is our data
template so we're going to say template
just like that and now we have our
profile store the next thing we need to
do is we need to actually create a
command for loading a player's profile
so we're going to say local function
load profile and this is going to accept
a player now with most of my variables
and arguments I like to assert its type
so that we can get better Auto
completion if you guys are unfamiliar
with type checking and stuff like that
Roblox you guys can check out my other
video or follow along and you might even
learn it while we go on so the type of
this variable is going to be a player
because of course when we call this
function we're going to pass through a
player the first thing we're going to do
is we're going to try to get that
player's profile so we're going to say
local profile equals profile store make
sure you say store not service and then
we're gonna use a colon to call a method
on this and we're going to say load
profile async then we need to pass
basically another other key to this and
the key is going to be player underscore
dot dot player.userid so now each player
has their own unique key for accessing
their profile now that we've got their
profile we might not actually have it so
we need to check if we do so we're going
to say if not profile then so this means
that if we didn't actually get their
profile then what we want to do is we
actually want to kick that player so
we're going to say player kick and now
we can pass a message inside of here
what we're going to do is we're going to
create a new variable called Kick
underscore message and that's going to
be all capital letters because it's
going to be a constant this message is
never going to change and this is going
to be equal to a string which says data
issue try again shortly if issue
persists contact us okay so that's going
to be your Kick message and then we're
going to put that variable inside of
this player kick right here so if the
player's profile doesn't load then we're
going to kick and then we also want to
say return as well because we want to
stop the script right there now if we
are able to find the players profile we
need to run a couple of methods on it so
we're going to say profile and then we
need to say add user ID and that's going
to accept the player.userid then we need
to run reconcile on it so we're going to
say reconcile and what reconcile is
going to to do is it's basically going
to look at our template and make sure
that the player's profile has all that
data and if it doesn't then it'll add
the new data to it and then finally we
need to say profile listen to release
and inside of here we're going to create
an anonymous function and then what
we're going to do is we are going to
kick the player and we're going to kick
them with the kick message once again
after that we need to check if the
player is descendant of and then the
player's service and if that equals true
then what we want to do is we want to
use the manager and get the profiles
table and then we want to add our player
to that table and we want to set the
variable equal to the profile so now
both the player and the profiler inside
of that table so anytime we index that
table with a player we will get their
profile which is perfect but if the
player is not a descendant of the
player's service then what we want to do
we want to call Profile release just
like that now there's one more thing
that we want to do and while we're
listening to the release we want to
remove the player's profile from this
table right here so what we're basically
going to do is we're just going to copy
this we're going to say manager.profiles
index that with the player and then
we're actually going to set that to nil
so that we remove the player's profile
from that table now that we have this
function all set up but we then need to
do is we need to listen for players to
join and then call this function for
them so we're going to say players dot
player added and we'll connect that to
the load profile function now
additionally because we're in studio
this script could load after other
players have already joined the game so
then we also need to Loop through all
the players that are currently in the
game as well so we're going to say four
underscore player in players get players
do and then we'll say task.spawn load
profile and pass through the player just
like that so now that we load their
profile and we add it to our table we
also need to make sure that we're
removing this as well when the player
leaves otherwise we're gonna have data
leaks so we want to make sure that we
listen for when they're leaving so
players.player moving connect create an
anonymous function inside of here which
is going to accept the player and then
we need to get their profile we're going
to say local profile equals manager dot
profiles index that with the player and
if we do find the profile so if profile
then we just want to call the release
method on the profile just like that so
now we have our player data pretty much
set up but the last thing we want to do
is we want to add leader stats to this
as well leader stats are incredibly
simple to set up so what we're going to
do is we're going to create a new
function towards the top of our script
call called create leader stats and this
is going to accept a player then the
first thing is is we're going to create
a variable for the player's profile so
we're going to say local profile equals
manager dot profiles and index that with
the player and if not profile so if the
profile doesn't exist then we're just
going to return n and stop the function
right there otherwise let's go ahead and
create a variable for the leader sets or
local leader stats equals instance dot
new folder and parent that to the player
we want to set the name of that folder
to leader stats spelled exactly like
that and that will create the leader
stats for both the clicks and our gems
currency so we're going to say local
clicks equals instance dot new number
value parent that to the leader stats
then we need to make sure that we set
the name of that to clicks and we need
to make sure that we set the value of
that to the
profile.data.clicks so now we have the
clicks value created the next thing
we're going to do is create the gems
value as well so we're going to say
local gems make sure that we change all
of those variables just like that change
the name of it make sure that's parented
to the leader stats and then also get
the data as well so instead of clicks
we're going to say gems and there we go
now we need to make sure that we
actually call this function and where we
gonna do that well we're going to call
it right after we set the player's
profile in the manager table so we're
going to say create leader stats pass
through the player just like that and
there we go now we can then go ahead and
start up our game and test this out and
make sure that it all works so as we can
see in the output it says profile
service Roblox API Services unavailable
data will not be saved but it is loaded
so that's good and we can also see that
we have the leader sets up here as well
which means that this is working
perfectly now if you did what your data
to save all you'd have to do is go to
the game settings go into security
enable Studio access to API Services hit
save and then when you start up your
game it should save your data perfectly
and we can even see the message it does
say that the data will be saved so
ladies and gentlemen with that being
said that's going to be it for this
episode we now have working player data
and we'll expand on that in the next
episode as well hopefully you guys did
enjoy if you did make sure you smash
like button also the Subscribe button
and turn this post notifications on if
you want to get notified when we open
more Roblox development content and I
have a patreon if you guys like this for
me and again access to a ton of scripts
and the game files including the ones
that I made in this episode this link
down below description and you guys can
go and check that out with that being
said I'll see you guys in the next
episode
foreign
[Music]
Ver Más Videos Relacionados
How to import data and install packages. R programming for beginners.
I Learned How to SCRIPT in 7 Days | Roblox
How to make a Roblox JOJO game #5 | Abilities
How to make a Roblox JOJO game #1 | Making Stand Summoning
Master Google Sheets with Node.js: Read & Write Data Effortlessly!
MERN quiz creator app Part 2: Creating a database, Creating a basic api, adding JWT authentication.
5.0 / 5 (0 votes)