Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't this Level Up System script work? (FIXED)

Asked by 6 years ago
Edited 6 years ago

on the first line, it is supposed to be like this

game.Players.PlayerAdded:connect(function(player)

I missed out the s in Players XD, I don't mind people borrowing this script and feel free to give credit :D

game.Playes.PlayerAdded:connect(function(player)
    local leaderstats = Instance.new("BoolValue",player) -- Creating the leaderstats
    leaderstats.Name = "leaderstats"
    local Level = Instance.new("IntValue",leaderstats) -- Making a Value called Level
    Level.Value = 1
    Level.Name = "Level"
    local XP = Instance.new("IntValue",leaderstats) -- Making a Value called XP
    XP.Value = 0
    XP.Name = "XP"
end) 

XP.Changed(connect(function()
if XP.Value => Level.Value*15 then -- Everytime your level is increased, it would be harder to level up
    Level.Value = Level.Value + 1 -- It adds 1 to your level
    XP.Value = 0 -- It resets your XP 

1 answer

Log in to vote
-1
Answered by 6 years ago

I have a question. Why did you use "BoolValue" instead of using a folder? when creating the leaderstats.

local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"

Ad

Answer this question