


Modules allow you to create functions to which you can call those functions. Now that we have that, we need to move to the Round module. Status.Value = "In order for the round to begin, there must be at least 2 players in the server." Your code should look like this: local Status = :WaitForChild("status")įor i, plr in pairs(game.Players:GetPlayers()) do We will need to also add in a for loop through all of the players and add them into the table. This way, we can detect how many players are actually ready.

Inside of this loop, we will need a table and add the players into that table. This way, it’ll wait until there are two players. in order to do so, we will need to put this into repeat-until loop. Next, in all most games, in order to begin it, you’ll need to detect if there are 2 or more players in the game. We will need to add in a while loop below the variables like so: local Status = :WaitForChild("status") Now, since this is a round-based game, we will need this game to run forever. To do so, we will need to code this: local Status = :WaitForChild("status") We will need to go to master in ServerScriptService to code access to the status stringvalue and require the module that is parented to it. You can also see in ReplicatedStorage, an event, items, and status value in the Value folder. Go here and edit it: Murder Mystery Template It’s uncopylocked too! Open it and move onto the actual coding! Part 1 - Coding the backendĪs you can see, in ServerStorage, you can see the map. In order to actually start coding, you’ll need the assets to work with. Anywho, if there are any questions and/or concerns, please let me know! Onto coding! Part 0 - Getting started Hello everyone! In this topic, you’ll be learning to create a murder mystery game! This took me about 6-7 hours in total (writing and coding of this tutorial) so I’ve put a lot of work and effort into this! This code is considered a beginner/intermediate level.
