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

leaderstat rank wont work?

Asked by 8 years ago

I cant seem to get this code to work.

    game.Players.Glassify.leaderstats.Rank.Value = Head Scripter 

I am trying to make my rank on the leaderstats Head Scripter but it wont work the other code that interacts with this code is the following.

local playerStats = {} --this keeps a list of the stats for each player that enters the game

 game.Players.PlayerAdded:connect(function(player)
     local leaderstats = Instance.new("Model", player)
     leaderstats.Name = "leaderstats"

     local grouprank = Instance.new("StringValue", leaderstats)
     grouprank.Name = "Rank"
     local rank = player:GetRoleInGroup() -- Insert the group ID for whatever group you want ranks displayed for here. 


     if rank ~= 0 then
         grouprank.Value = rank
     else
         grouprank.Value = "Guest"
     end


     playerStats[player] = leaderstats 
 end)


2 answers

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

Since you are attempting to assign a value to a string value, you have to indicate it is a string, using " or '.

game.Players.Glassify.leaderstats.Rank.Value = "Head Scripter"
Ad
Log in to vote
0
Answered by 8 years ago

Uh,

game.Players.Glassify.leaderstats.Rank.Value = "Head Scripter"

You forgot to turn it into a string. Also, make sure that Glassify exists at the time you're running it.

0
LOL Right at the moment you said that I was like OH DERP I FORGOT TO MAKE IT A STRING Glassify 15 — 8y
0
Mm. User#6546 35 — 8y

Answer this question