Level System (HELP)

Hello everyone I wanted to ask if someone can help me to make a level system. I wanted that when you go up a level, for example, you unlock a new item

I’m not very familiar with scripts and that’s why I need your help

thanks, people
Bye for now
DerBusfahrer12
:grinning:

  1. u can use math for example every time a player levels up make it so they need 10 more XP to level up
  1. if u want each level to have its own unique XP capacity u can use tables and store all the data there for example how much XP a player needs for a certain level and etc

when the player loads in the game u can create intvalue inside the player itself and make the value of it the level of the player and then check on the server if the player has enough level to buy the item

1 Like

You have million ways to create level systems. It’s really up to you though.

Assuming levels work with EXP points, you can either:

  • Each level has a set EXP goal, when met player levels up and their EXP is set back to 0 (or more if on level up exp overflows)
  • Level is determined by total EXP gained (ex. 1 needs 200, 2 requires 500, however exp is never reset to 0)

To do these, you need to plan out how your leveling logic works. This is an example you would not want to do:

local levels = {
  100,
  200, 
  300
}

-- now if we want to see the exp required for each level:
for level, required in ipairs(levels) do
  print("Required EXP for level " .. level .. ": " .. required)
end

--[[ Output:
	Required EXP for level 1: 100
	Required EXP for level 2: 200
	...
]]

Well, don’t do that. You have way easier ways to do that, one of them is creating a logic, so the exp required for each level increases from previous level.

Additionally we want that level and EXP gained to save between sessions, this requiring the use of DataStoreService.

To grant items, use a function. When the player levels up, i.e. hits a certain EXP amount, said function is fired. Within that function we check the current player level, if it meets a certain required level, we grant the player an item (which can be a tool or anything you require.)
Just make sure you don’t use elseif statements when checking new player level:

function onPlayerLeveledUp(newLevel)
	if newLevel == 10 then
		-- item
	elseif newLevel == 20 then
		-- item
	end
	-- In short, just, don't.
end

We’re not YandereDev.

It’s all about trial and failure. I can’t provide with a full script, because, meh, no spoonfeeding here.

1 Like

Also, bad practice, don’t do this. That’s what I just said:

1 Like

how is this a bad practice ??? hm

if u need custom exp capacity for ur level system u can’t just use “Math”

1 Like

Many thanks for your help as soon as I’ve tried it and it works I’ll mark it as a solution :grinning:

Because that’s not how levels logic work. Would you seriously waste an entire Module storing a whole table of levels? You’d need to create more and more levels as players level up (because nowadays people have no lives). Using set EXPs is not useful either, because as you level up, it’s supposed to become harder to (except Zombie Attack, for some reason their levels system is the same past 150 or something).

It’s easier to create a few lines using math which increases the required EXP for the next level. Use Desmos to create your desired graph.

1 Like

it’s not like people don’t use tables to store stats of the weapons lol it’s not a big deal

also, nobody updates there game just to add more levels to game

1 Like

yeah because you can’t change weapon stats using math

local weapons = {
	["AK-47"] = {
		["MaxAmmo"] = 30, 
		["FireRate"] = 700, 
		["FireType"] = "Single"
	},
}

you can store weapon information on a table because they’re not supposed to change, as to levels.
would you seriously want to do that?

local levels = {
	100,
	250,
	525,
	69420,
	1008393,
	29736528,
	-- ...
}

No, I would not waste my time doing that.

1 Like

if u need each level to have its own unique exp capacity u can’t just use math its actually a pretty good choice because u can customize ur level system more

1 Like

While it being pointless and a waste of memory, that is.

1 Like

its not like most Roblox games have over 2 k tables

and its not pointless because u can design ur level system and make it much more unique

1 Like

tell me a game that has the nuts to use that system

1 Like

Northwind

its also partnered with Roblox itself

1 Like

Whatever, just use logics. It’s better for your game and its future.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.