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

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

Asked by 6 years ago
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

0
you're suppose to name it "leaderstats" User#23365 30 — 6y
0
also :connect() is deprecated, use :Connect() and use local functions User#23365 30 — 6y
0
also add more white space to ur code User#23365 30 — 6y
0
you forgot all the .Values in OnLevelUP GoldAngelInDisguise 297 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Line 10

 leaderstats.Name = "leaderboard"

should be

 leaderstats.Name = "leaderstats"

0
it's spelt board and leaderstats must have a lowercase in order to work Ziffixture 6913 — 6y
0
Edited - apologies for typos 95jake95 14 — 6y
Ad

Answer this question