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."
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
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."