Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

i making this script but it wont show in leaderboard how do i fix this?

function OnLevelUP(xp,nxp,mgrass,rank,cash)
	if xp.Value >= nxp.Value then
       mgrass = mgrass +5
	   rank = rank +1
	   cash = cash +20 +rank.Value+20
	   nxp = nxp +20
end end
(game.Players.PlayerAdded:connect(function(player)
    local leaderstats = Instance.new("Model")
    leaderstats.Name = "leaderborad"
    leaderstats.Parent = player
    local grass = Instance.new("IntValue")
    grass.Name = "Grass"
    grass.Value = 0
    grass.Parent = leaderstats
    local mgrass = Instance.new("IntValue")
    mgrass.Name = "MaxGrass"
    mgrass.Value = 20
    mgrass.Parent = leaderstats
	local money = Instance.new("IntValue")
	money.Name = "Cash"
	money.Value = 10
	money.Parent = leaderstats
	local xp = Instance.new("IntValue")
	xp.Name = "XP"
	xp.Value = 21
	xp.Parent = leaderstats
	local nxp = Instance.new("IntValue")
	nxp.Name = "NXP"
	nxp.Value = 20
	nxp.Parent = leaderstats
	local rank = Instance.new("IntValue")
	rank.Name = "Rank"
	rank.Value = 1
	rank.Parent = leaderstats
xp.Changed:connect(function()OnLevelUP(xp,nxp,mgrass,rank,cash)
end)end

Here a Error Script

4 comments

0

you're suppose to name it "leaderstats"

0

also :connect() is deprecated, use :Connect() and use local functions

0

also add more white space to ur code

0

you forgot all the .Values in OnLevelUP

1 answer

Line 10

 leaderstats.Name = "leaderboard"

should be

 leaderstats.Name = "leaderstats"

2 comments

0

it's spelt board and leaderstats must have a lowercase in order to work

0

Edited - apologies for typos

This discussion is preserved as it was. New answers, comments, and votes are closed.