Hello so im making XP System for my game and it always say this error
local Prefix = "/"
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(14493575) == "3" or plr:GetRankInGroup(14493575) == "4" or plr:GetRankInGroup(14493575) == "255" then
plr.Chatted:Connect(function(msg)
local loweredString = string.lower(msg)
local args = string.split(loweredString," ")
if args[1] == Prefix.."addxp" then
local target = game.Players:FindFirstChild(args[2])
local datafolder = target:WaitForChild("DataFolder")
local xpvalue = datafolder.XP
xpvalue += args[3]
if xpvalue == 20 then
local GlitchURL = "**Censored**" --Place the glitch project URL inside of the quotes
function rankUser(UserId, RoleId)
game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end
local UserId = target.UserId --Replace 12345 with the users userid
if target:GetRankInGroup(14493575) == "1" then
local RoleId = 2
rankUser(UserId, RoleId)
end
end
elseif args[1] == Prefix.."removexp" then
local target = game.Players:FindFirstChild(args[2])
local datafolder = target:WaitForChild("DataFolder")
local xpvalue = datafolder.XP
xpvalue -= args[3]
if xpvalue == 0 then
local GlitchURL = "**Censored**" --Place the glitch project URL inside of the quotes
function rankUser(UserId, RoleId)
game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end
local UserId = target.UserId --Replace 12345 with the users userid
if target:GetRankInGroup(14493575) == "2" then
local RoleId = 1
rankUser(UserId, RoleId)
end
end
end
end
end
end)
end
end)