so, my friend gave me a rank system and it worked for him but didn't for me, there were no errors outputted, heres the code...
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | plr.CharacterAdded:Connect( function (char) |
03 | wait( 3 ) |
04 |
05 | local cTag = game:GetService( "ServerStorage" ):WaitForChild( "Tag" ):Clone() |
06 | cTag.Parent = char.Head |
07 |
08 | cTag.PlrName.Text = plr.Name |
09 | cTag.Rank.Text = "Dumb Newbie" |
10 |
11 | if plr:WaitForChild( "leaderstats" ):FindFirstChild( "Rebirths" ).Value < = 0 then |
12 | cTag.Rank.Text = "Dumb Newbie" |
13 | elseif plr:WaitForChild( "leaderstats" ):FindFirstChild( "Rebirths" ).Value < = 3 then |
14 | cTag.Rank.Text = "Smart Newbie" |
15 | elseif plr:WaitForChild( "leaderstats" ):FindFirstChild( "Rebirths" ).Value < = 5 then |
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?
I think I know the problem, you haven't made a leaderstats. To do this, you'll need to add a script to the ServerScriptService and copy / paste the following.
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | local leaderstats = Instance.new( 'Folder' , player) |
3 | leaderstats.Name = 'leaderstats' |
4 |
5 | local Rebirths = Instance.new( 'NumberValue' , leaderstats) |
6 | Rebirths.Name = 'Rebirths' |
7 | Rebirths.Value = 0 |
8 | end ) |
Note: This was from the top of my head, so please don't judge me. Hope this helped you.
Use localscript and put into StarterPlayerScripts, and the Tag from ServerStorage put in ReplicatedStorage. EDIT:
https://gyazo.com/95b106c082a78c9787aa898d71a9e5d3
01 | local plr = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() |
02 | local char = plr.Character or plr.CharacterAdded:Wait() |
03 | if char then |
04 | local head = char:WaitForChild( "Head" ) |
05 | if head then |
06 | local cTag = game:GetService( "ReplicatedStorage" ).Tag:Clone() |
07 | cTag.Parent = head |
08 |
09 | while wait() do |
10 | cTag.PlrName.Text = plr.Name |
11 | if plr:WaitForChild( "leaderstats" ).Rebirths.Value < = 0 then |
12 | cTag.Rank.Text = "Dumb Newbie" |
13 | elseif plr:WaitForChild( "leaderstats" ).Rebirths.Value < = 3 then |
14 | cTag.Rank.Text = "Smart Newbie" |
15 | elseif plr:WaitForChild( "leaderstats" ).Rebirths.Value < = 5 then |