I made a script that give you a title depending on how many wins you have, but when you have 6 wins, the title doesn't change, and no errors appear in the output.
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(char) local wins = p.leaderstats.Victories local titles = game.ServerStorage.Titles if wins.Value == 0 and wins.Value < 5 then titles.Noob:Clone().Parent = char.Head char.Head:WaitForChild("Noob").Enabled = true if wins.Value == 6 and wins.Value < 14 then print(wins.Value) char.Head:WaitForChild("Noob"):Destroy() titles.Amateur:Clone().Parent = char.Head char.Head:WaitForChild("Amateur").Enabled = true end end end) end)
First off, you are forgetting to acknowledge if they have 5 wins. So on that section of the code you should refer to less than or equal to 5.
I believe the code is not pulling through because you are waiting on the Noob title to be given though it wouldn't if they have 6 or more wins. Additionally, I would clean up the code a bit to continue on with your if statements as elseif and remove that extra useless end. Here is a fixed version I believe should work:
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(char) local wins = p.leaderstats.Victories local titles = game.ServerStorage.Titles if wins.Value <= 5 then titles.Noob:Clone().Parent = char.Head char.Head:WaitForChild("Noob").Enabled = true elseif wins.Value >= 6 and wins.Value <= 14 then if char.Head:FindFirstChild("Noob") then char.Head.Noob:Remove() end titles.Amateur:Clone().Parent = char.Head char.Head:WaitForChild("Amateur").Enabled = true end end) end)
I'm not the best at explaining things, if this does work but you are still confused on how to fix it, please comment back or look for other scripters to comment that are more experienced than myself. Hope this helps!!
******EDIT I adjusted it so that the giver works properly for 5 or less wins and 6 or more. On the first line, you just need to reference if they have 5 or less wins, there is no need to see if they have 0 wins, this does it already. On the elseif line, you have to make sure you compare greater than or equal to on the first part of the phrase, not just equal to.