Best way to make "levels" in a game?

I have a place that serves as a tutorial for different classes in the main game, however i’m not sure how to make a level for each class. How can i achieve this?

1 Like

The most simple way I have in my mind is making IntValue for each of them inside of a character and it would save value in the datastore. It’s pretty simple to any ‘leaderboard money/level’.

I would use the values within the player’s data itself

Maybe make it like zombie attack where you just have to get 1k xp to get to the next level and all what you will have to do is using

math.floor(Player.leadestats.Xp.Value/1000)

And it will return the level

I dont meant levels as in rank, i mean levels that you can play, like level 1-1 or level 2-3

You can put the levels inside server storage and then when the player is done from a level then you delete the clone of the first level and clone the second level

1 Like

I’m not a 100% sure what you mean by making a level for each class so correct me if I’m wrong.

You’re trying to teleport Players to another experience which is a tutorial but gives a different tutorial for every class?

Yes, but i want to just use 1 place for convenience.

As @mhmdsndb3 said, just store the separate levels in ServerStorage and clone them whenever necessary. That’s only one approach (there are multiple ways to handle something like this), and if your levels are mainly static, a better apporach would be to just keep them in Workspace and move players around when they complete/lose/etc.

I think the most logical approch is just to make multiple tutorial levels like 20000 studs away and teleport players there.

But if you only want one player per tutorial place then I would put all the tutorials in ServerStorage and copy them if a player needs one.

Like this:

local Distance_Between_Tutorials = 5 
local Distance_From_Z0 = 50

local Amount_Places = 0

local function PlayerTeleport(Player)
	local Place 
	-- I added a folder called "Data" with a  string value named "Class" when the player joined
	if Player:FindFirstChild("Data").Class.Value == "Mage" then -- Checks if player is "Mage" Class
		Place = game.ServerStorage:FindFirstChild("Tutorials").Mage_Tutorial:Clone()
	elseif Player:FindFirstChild("Data").Class.Value == "Archer" then -- Checks if player is "Archer" Class
		Place = game.ServerStorage:FindFirstChild("Tutorials").Mage_Tutorial:Clone()
	end
	
	-- You have to select a primary part for the tutorial place
	Place:SetPrimaryPartCFrame(CFrame.new(Amount_Places * Distance_Between_Tutorials, 0, Distance_From_Z0)) -- Moves tutorial
	print(Place.PrimaryPart.Position)
	Place.Parent = workspace
	
	Amount_Places = Amount_Places + 1
end

game.Players.PlayerAdded:Connect(function(Player) -- Add "Data" to the player
	local Folder = Instance.new("Folder",  Player)
	Folder.Name = "Data"

	local Class = Instance.new("StringValue", Folder)
	Class.Name = "Class"
	Class.Value = "Mage"
	
	PlayerTeleport(Player)
end)

Best thing u could use for a class system, is to get familiar with OOP (Object Oriented Programming), It will help out a ton.

I have never heard of OOP but I’ve searched it. But how do you use it in this instance? Would you make module scripts for each class with functions for only that class?