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.
4 comments
I added an if statement to check if the player had the Noob title that needs to be removed. The way you have it coded though, it shouldn't give it anyways, so that if statement checking for the Noob title isn't really needed.
There are problems: if you don't have 0 or 6 victories, then nothing appears above your head
I have corrected the code above Boi, I made a mistake, sorry about that!
Please check the reply and let me know if it solved the issue. Don't forget to accept the answer if it works! Thanks!