Long story short, im making a game where theres a level up system based on kills and I use the script
local maxlevel = 100 game.Players.PlayerAdded:connect(function(player) local stats = Instance.new("IntValue", player) stats.Name = "leaderstats" local level = Instance.new("IntValue", stats) level.Name = "Level" level.Value = 1 local exp = Instance.new("IntValue", stats) exp.Name = "Exp" exp.Value = 0 while wait() do local extralevel = level.Value local expneed = ((extralevel * 2) - 1) * 50 if level.Value < maxlevel then if exp.Value >= expneed then level.Value = level.Value + 1 exp.Value = exp.Value - expneed end end end end)
2 questions: 1, I made a working gui version of displaying the level, HOWEVER it wont update when you level up it works the first time but wont no more, help, to go along with the leveling up. 2, Using this script how would I make it so if you kill someone you get exp?
Not sure as you don't have the script for the display but hopefully this fixes your problem.
local player = game.Players.LocalPlayer local stats = player:WaitForChild("leaderstats") local level = stats:WaitForChild("level") -- change level to your statname function update() script.Parent.Text = level.Value end update() level.Changed:connect()