With the game I'm developing, I'm trying to incorporate a script that can rank someone in my group. The ranking and all works perfectly fine, but when I try inserting my level check, it outputs this error: http://prntscr.com/fzo2a3
What I'd like to know is why the playerLevel variable indexes as nil being that I've used the same methods for the playerLevel variable in other scripts and haven't had an issue.
local group = require(game.ServerScriptService:WaitForChild("GroupFunctions"))
local domain = ""
local key = ""
local groupId =
local api = group(domain, key, groupId)
game.Players.PlayerAdded:connect(function(player)
local user = player.UserId
local playerLevel = game.ReplicatedStorage:FindFirstChild(player.Name.."Level")
if player:IsInGroup(groupId) then
if player:GetRankInGroup(groupId) >= 1 and player:GetRankInGroup(groupId) < 10 then
if playerLevel.Value >= 250 and playerLevel.Value <= 499 then
print(api.setRank(user, 2).message)
elseif playerLevel.Value >= 500 and playerLevel.Value <= 749 then
print(api.setRank(user, 3).message)
elseif playerLevel.Value >= 750 and playerLevel.Value <= 998 then
print(api.setRank(user, 4).message)
elseif playerLevel.Value >= 999 then
print(api.setRank(user, 5).message)
end
end
end
end)

3 comments
Does this happen to be stolen code lol....
is there supposed to be a space in between the player's name and Level? For example: In you current script, it would look like this: Alpha_ToonLevel when I think you are wanting your script to check for this: Alpha_Toon Level. If so, just add a space before Level inside your string (" Level")
@Era_Gamer No, don't know why you think that. @bigboy77584 It's supposed to have no space