Hello, I am trying to add level requirements to a basic f4 menu. However, it is giving me an odd error (look below) and making all of the jobs a "vote required" job. I am not sure why it is doing this. I assume it is because of where I put lvl_req. I am not sure where to put it and was hoping someone here did. Thanks
CODE:
if (not v.RequiresVote and v.vote) or (v.RequiresVote and v.RequiresVote(LocalPlayer(), k)) then
local condition = ((v.admin == 0 and LocalPlayer():IsAdmin()) or (v.admin == 1 and LocalPlayer():IsSuperAdmin()) or LocalPlayer().DarkRPVars["Priv"..v.command])
if not v.model or not v.name or not v.description or not v.command then chat.AddText(Color(255,0,0,255), "Incorrect team! Fix your shared.lua!") return end
AddIcon(k, v.max, v.model, v.name, v.description, weps, "/vote"..v.command, condition, "/"..v.command, v.lvl_req)
else
if not v.model or not v.name or not v.description or not v.command then chat.AddText(Color(255,0,0,255), "Incorrect team! Fix your shared.lua!") return end
AddIcon(k, v.max, v.model, v.name, v.description, weps, "/"..v.command, v.lvl_req)
**First line is 707 and last line is 713**
LUA ERROR:
[ERROR] gamemodes/medievalrp/gamemode/client/showteamtabs.lua:589: attempt to concatenate upvalue 'lvl_req' (a nil value)
1. unknown - gamemodes/medievalrp/gamemode/client/showteamtabs.lua:589
icon.OnCursorEntered = function()
icon.PaintOverOld = icon.PaintOver
icon.PaintOver = icon.PaintOverHovered
local JobName = DarkRP.getPhrase("job_name") .. name
Info[1] = DarkRP.getPhrase("job_description") .. description
Info[2] = DarkRP.getPhrase("job_weapons") .. Weapons
Info[3] = "Level Requirement: " .. lvl_req
**Line 589 is the last line**
Don't modify the DarkRP gamemode itself.
Take a gander: GitHub
Maybe it'll help you create one
Sorry, you need to Log In to post a reply to this thread.