I've got this script and it throws an error.
This is the error
attempt to concatenate global 'Ranks' (a table value)
And the line that throws it is
script.Parent.heading.Text = "My rank: ".. Ranks ..". Click here for game stats."
Help?
I've got this script and it throws an error.
This is the error
attempt to concatenate global 'Ranks' (a table value)
And the line that throws it is
script.Parent.heading.Text = "My rank: ".. Ranks ..". Click here for game stats."
Help?
Your trying to concatenate a table, which of course, you can't do. You need to pull a certain value from the table to concatenate.
For example:
Ranks = {"Civillian", "Rookie", "Veteran", "Specialist", "Captain", "Commander", "Legend"}
script.Parent.heading.Text = "My rank: "..Ranks[1]..". Click here for game stats."
Yeah, I need it to show all as you move up in the game.
I'll answer one sec.
Ranks = {"Civillian", "Rookie", "Veteran", "Specialist", "Captain", "Commander", "Legend"}
script.Parent.heading.Text = "My rank: "..table.concat(Ranks,',')..". Click here for game stats."
That should show all the ranks in the table.
Ok let's say you I made a IntValue to show XP
z = Isntance.new("IntValue",script.Parent)
z.Name = "XP"
Ranks = {"Civillian", "Rookie", "Veteran", "Specialist", "Captain", "Commander", "Legend"}
if z.Value == 1 then -- Example XP
script.Parent.heading.Text = "My rank: "..Ranks[1]..". Click here for game stats."
end
-- Another so you can get the point
if z.Value == 2 then -- Example XP
script.Parent.heading.Text = "My rank: "..Ranks[2]..". Click here for game stats."
end
http://puu.sh/9kUbW/e8995e7eac.jpg It shows this, but I only want to show one depending on your XP.
Mk.
There's already a xp value in the playerdata in Workspace. It's a model.
Since the formatting is wrong on the comments, I'm putting the lines leading up to ranks here.
These are the lines leading up to ranks.
repeat wait() until workspace.playerdata:FindFirstChild(game.Players.LocalPlayer.Name)
data = Instance.new("ObjectValue")
data.Parent = script
data.Value = workspace.playerdata:FindFirstChild(game.Players.LocalPlayer.Name)
levels = {100,500,1250,2500,5000,10000}
Ranks = {"Civillian", "Rookie", "Veteran", "Specialist", "Captain", "Commander", "Legend"}
able = false
script.Parent.heading.Text = "My rank: ".. Ranks ..". Click here for game stats."
You know you can edit.
I answered!
This discussion is preserved as it was. New answers, comments, and votes are closed.
6 comments
Is "ranks" defined?
Can we see the lines that deal with Ranks?
Agreed ^
Sure.
Mine will show all the ranks.
Done