So I am trying to make an obby and I have stages. In the leaderboard, I have 2 values: Coins and levels. So what I am trying to explain is that when the player completes the level and stands on the checkpoint, the levels value should increase as the player completes the level. How can I achieve this?
well, just add a script in the brick that will be touched to level up, and add an integer value(Int value) in the brick and give it a value of the level; then do the following
script.Parent.Touched:connect(function(touching) local parent = touching.Parent locla humanoid = Parent:FindfirstChild("Humanoid") local player; if humanoid then player = game.Players:GetPlayerFromCharacter(parent) if player then local leaderstats = player.leaderstats local level = leaderstats.Level -- rename level to whatever the level value is named level.Value = script.Parent.LevelValue -- change this to the name of the number value in the brick end end end)