Pretty simple one since I'm a noob... The code here simply puts a column of XP and Levels in your leaderboard. The levels take more XP each time to move-on. The max level = 100..**** I want my XP value to increase by 10 every 22.0385674931 seconds until the player reaches level 100?? **** I am super near to completing it... but I cannot get my XP to increase over time without voiding the level/xp linking script.?? If a level takes 100 XP to pass... and you enter 150 as the value you will be take to the next level and 50 XP with my current script.

local maxlevel = 100
local user = game.Players.LocalPlayer

game.Players.PlayerAdded:connect(function(plr)
	local stats = Instance.new("IntValue", plr)
	stats.Name = 'leaderstats'
	local Gold = Instance.new("IntValue", stats)
	Gold.Name = "Gold"
	Gold.Value = 0
	local Rank = Instance.new("StringValue", stats)
	Rank.Name = "Rank"
	Rank.Parent = stats 
	Rank.Value = plr:GetRoleInGroup(2850731)
	if Rank.Value == ("Lead Developer")
		 then plr.TeamColor = BrickColor.new("Navy blue")
	else if Rank.Value == ("Developers")
		then plr.TeamColor = BrickColor.new("Navy blue")
	else if Rank.Value == ("Admins/Mods")
		then plr.TeamColor = BrickColor.new("Navy blue")
	else if Rank.Value == ("Elder")
		then plr.TeamColor = BrickColor.new("Dirt Brown")
	else if plr.Name == ("FoxykingDayZ")
		then plr.TeamColor = BrickColor.new("Maroon")
	else if Rank.Value == ("King of The Seven Kingdoms") or Rank.Value == ("Queen of The Seven Kingdoms")
		then plr.TeamColor = BrickColor.new("Earth green")
	else if Rank.Value == ("Hand of the King") or Rank.Value == ("Small Council")
		then plr.TeamColor = BrickColor.new("Earth green")
	else if Rank.Value == ("Lord/Lady Paramount")
		then plr.TeamColor = BrickColor.new("Earth green")
	else if Rank.Value == ("Lord") or Rank.Value == ("Lady")
		then plr.TeamColor = BrickColor.new("Dirt brown")
	else if Rank.Value == ("Kingsguard") or Rank.Value == ("City Watch")
		then plr.TeamColor = BrickColor.new("Deep orange")
	else if Rank.Value == ("Highborn")
		then plr.TeamColor = BrickColor.new("Dirt brown")
	else if Rank.Value == ("Knight") or Rank.Value == ("Squire")
		then plr.TeamColor = BrickColor.new("Institutional white")
	else if Rank.Value == ("Footman") or Rank.Value == ("Westerosi")
		then plr.TeamColor = BrickColor.new("Institutional white")
	end
	end
	end
	end
	end
	end
	end
	end
	end
	end
	end
	end
	end
	local level = Instance.new("IntValue", stats)
	level.Name = "Level"
	level.Value = 1
	local exp = Instance.new("IntValue", stats)
	exp.Name = "XP"
	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)

3 comments

0

How do i post the script?

2

Use elseif, one word. That way you don't need TONS OF ENDS.

0

Why are you adding 'leaderstats' in a local script??