Attempt to call method "MaxwellGetPlayerGroup" (a nil value)
9 replies, posted
https://files.facepunch.com/forum/upload/268614/fe065e7e-572c-4fc4-a993-27b707b52711/Untitled.png
So I'm using this free leveing system from workshop and I have edited HUD of it to fit the HUD I'm currently using, and added few perks, nothing else, never edited this timers.lua file which is giving the error, this is the full code of timers.lua, as I said, never edited anything related to user groups, I do use ULX but this addon is compatible with it. I would contact the owner but he left this script years ago.
if (Maxwell.AutoXP) then
// Auto-XP timer
timer.Create( 'AutoXPTimer', Maxwell.AutoXPInterval, 0, function()
for k,v in pairs(player.GetAll()) do
local PLevel = tonumber(v:PlayerLevel())
local PLevel2 = math.floor(PLevel / 10)
local PlayerGroup = v:MaxwellGetPlayerGroup()
local GroupAmount = v:GetGroupAmount()
local GroupMultipler = v:GetGroupMuptipler()
if (Maxwell.IncreasedXPHighLevel) and not (Maxwell.GroupAutoXP) and not (Maxwell.CustomGroupXP) then
v:GiveXP(Maxwell.AutoXPAmount + (PLevel2 * 10))
elseif (Maxwell.IncreasedXPHighLevel) and (Maxwell.GroupAutoXP) and not (Maxwell.CustomGroupXP) then
v:GiveXP(math.Round(Maxwell.AutoXPAmount * GroupMultipler + (PLevel2 * 10) , 1))
elseif (Maxwell.IncreasedXPHighLevel) and (Maxwell.CustomGroupXP) and not (Maxwell.GroupAutoXP) then
v:GiveXP(GroupAmount + (PLevel2 * 10))
elseif (Maxwell.IncreasedXPHighLevel) and (Maxwell.CustomGroupXP) and (Maxwell.GroupAutoXP) and (PlayerGroup) then
v:GiveXP(math.Round(GroupAmount * GroupMultipler + (PLevel2 * 10) , 1))
elseif (Maxwell.IncreasedXPHighLevel) and (Maxwell.CustomGroupXP) and (Maxwell.GroupAutoXP) and not (PlayerGroup) then
v:GiveXP(math.Round(Maxwell.AutoXPAmount * GroupMultipler + (PLevel2 * 10) , 1))
else
v:GiveXP(Maxwell.AutoXPAmount)
end
end
end)
end
MaxWellGetPlayerGround is a function. And TBH i dont know if its a gmod function or a self made. But id say a self made. It doesnt exist.
And since you said the Creator left the Script Years ago it probably wont work anymore anyway, since gmod changed alot over the years.
You should look for a newest script. Because this one is probably to old to even work at all
Any way I can replace those lines of codes with a new ones? You got any idea of the new ones?
Definitely isn't a default function.
@crane8382 you probably have a startup error that keeps the function from being created.
Wouldn't have anything on mind what could stop it on startup to be honest.
You would need to rebuild the whole function and everything else thats missing from scratch.
Making a whole new addon yourself would be easier. Really, just find a new Addon
Right, it's all good then, sad it doesn't work anymore as I've just finished implementing it with HUD and it fits it perfectly, works perfectly aswell, all good tho thank you for your help.
When you try to edit a addon you should first check how old it is and when it has been updated last
Will consider doing that next time, thank you again for your help
This looks like it came from an old addon indeed. In your case "v" is a player, and the player does not have a method called "MaxwellGetPlayerGroup". That's why when you call v["MaxwellGetPlayerGroup"] will result in a nil value instead of returning a reference to a function ;)
Sorry, you need to Log In to post a reply to this thread.