Good Afternoon fellow Roblox Developers! I have just recently been allowed access to the Roblox the development forum and unfortunately must come to you all with a bug or issue that I cant seem to get over. I’m trying to make a basic level system that will increase levels when detecting a certain amount of experience has been reached. Sounds simple enough right? Well not for me it seems.
Below I’ve attached my very basic code that doesnt seem to work.
This script is located in the ServerScriptService.
game.Players.PlayerAdded:Connect(function(player)
local leader = Instance.new("Folder")
leader.Name = "leaderstats"
leader.Parent = player
local lvl = Instance.new("IntValue")
lvl.Name = "Level"
lvl.Parent = player:WaitForChild("leaderstats")
local xp = Instance.new("IntValue")
xp.Name = "Experience"
xp.Parent = leader
local rxp = Instance.new("IntValue")
rxp.Name = "ReqEXP"
rxp.Parent = leader
local pfaction = Instance.new("StringValue")
pfaction.Name = "Faction"
pfaction.Parent = leader
-- When XP Changes check for Level up --
xp.Changed:Connect(function()
print("EXP Changed")
end)
end)
All I’m trying to do for the time being is to recognize the change so I can edit it at a later time. However when I change the experience after pressing play in the studio nothing happens. Any help would be much appreciated!