game.Players.PlayerAdded:connect(function(Player) ----- When a Player joins a server this function happens
local Data = Instance.new("IntValue",Player) ----Makes an IntValue inside Player
Data.Name = "Data" -----It's name is Data ([Note]: You could change it to leaderstats if you would like a leaderboard with it.)
local XP = Instance.new("IntValue",Data) ----Makes a IntValue inside Data
XP.Name = "XP"
XP.Value = 0
local Level = Instance.new("IntValue",Data) ------- Makes an IntValue Inside Data
Level.Name = "Level" ------- It's name is Level
Level.Value = 1
XP.Changed:connect(function() XPChange(Player,XP,Level) end) ---- To change the XP, XPChanged function occours
end)
function XPChange(Player,XP,Level) ------ XPChanged function
if XP.Value >= Level.Value*150 then ----- this function occours happens if the Level's Value is greater or equal to this 150 ([Note]: Change 150 to the max XP)
XP.Value = 0 --- Resets the XP
Level.Value = Level.Value+ 1
end
end
COMMUNITY QUESTION
How do I make this FE Compatible?
1 answer
By just making it a global script. There is no reason why it should be local.
2 comments
0
It is, but its because of Filtering Enabled it will not work. so it works in studio but not when I play the actual game.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
What makes me angry is because the reason why people use connect instead of Connect connect is depricated and it can only work in roblox studio but not in the released game I always recommend Connect instead of connect
Why you made the .PlayerAdded function in a LocalScript?
Its not a local script