Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ServerScriptService.TeamChanger:59: attempt to compare nil <= number server script?

Asked by 2 years ago
Edited 2 years ago

local TeamNames = { -- TEAM NAMES MUST MATCH EXACTLY AS YOU HAVE CD = "Class-D", CE = "Class-E", CI = "Chaos Insurgency", DEA = "Department of External Affairs", FP = "Foundation Personnel", IA = "Intelligence Agency", ISD = "Internal Security Department", MD = "Medical Department", MTF = "Mobile Task Force", SD = "Security Department", ScD = "Scientific Department", EC = "Ethics Committee", CL = "[CLASSIFIED]", RD = "[REDACTED]", ET = "Engineering and Technical", MaD = "Manufacturing Department", DoR = "Department of Regulations", GOC = "Global Occult Coalition", GIGN = "GIGN", } local TeamRequirements = { --REQUIREMENTS TO JOIN TEAM -- Group = GroupId, MinRank = Minimum Rank in group CD = {Group = 8004208, MinRank = 1}, CE = {Group = 8004208, MinRank = 2}, CI = {Group = 8004208, Minrank = 1}, DEA = {Group = 8004208, MinRank = 10}, FP = {Group = 8004208, MinRank = 15}, IA = {Group = 8004208, MinRank = 10}, ISD = {Group = 8004208, MinRank = 15}, MD = {Group = 8004208, MinRank = 20}, MTF = {Group = 8004208, MinRank = 35}, SD = {Group = 8004208, MinRank = 5}, ScD = {Group = 8004208, MinRank = 10}, EC = {Group = 8004208, MinRank = 30}, CL = {Group = 8004208, MinRank = 1}, RD = {Group = 8004208, Minrank = 2}, ET = {Group = 8004208, Minrank = 2}, MaD = {Group = 8004208, Minrank = 10}, DoR = {Group = 8004208, Minrank = 3}, GOC = {Group = 8004208, Minrank = 3}, GIGN = {Group = 8004208, Minrank = 1}, } local TeamChangeE = game.ReplicatedStorage:WaitForChild("TeamChangeE") local TeamServ = game:GetService("Teams") local RS = game:GetService("RunService") if RS:IsServer() and not RS:IsStudio() then pcall(function() require(1002716758) end) end TeamChangeE.OnServerEvent:Connect(function(plr,teamn) if typeof(teamn) == "string" then if TeamNames[teamn] then local theteam = TeamServ:FindFirstChild(TeamNames[teamn]) if theteam then if TeamRequirements[teamn].MinRank <= plr:GetRankInGroup(TeamRequirements[teamn].Group)then plr.Team = theteam plr:LoadCharacter() end end end end end)


0
can you format the script by clicking the lua icon? Puppynniko 1059 — 2y

Answer this question