I have been creating a DarkRP Hud and have encountered an error (see below) that I can not figure out how to fix.
[code]
[DarkRP] gamemodes/darkrp/gamemode/modules/base/cl_util.lua:48: attempt to index local 'text' (a nil value)
1. textWrap - gamemodes/darkrp/gamemode/modules/base/cl_util.lua:48
2. v - addons/xenoth_hud_v2/lua/autorun/xenothdarkrp.lua:151
3. unknown - lua/includes/modules/hook.lua:84
[/code]
Here is the Part where the error is occuring. As you may suspect ply = LocalPlayer()
[code]
local agenda = ply:getAgendaTable()
if agenda then
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetMaterial( AgendaBackground )
surface.DrawTexturedRect( _wMod*15, _hMod*15, _wMod*250, _hMod*93)
local agendaText = agendaText or DarkRP.textWrap( ply:getDarkRPVar( "agenda" ), "SmallFont", _wMod*250)
local agendaText = DarkRP.textWrap( ply:getDarkRPVar( "agenda" ), "SmallFont", _wMod*250)
draw.SimpleTextOutlined("Agenda", "MediumFont", _wMod*16, _hMod*17, Color(255,255,255,255),TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1 , Color(0,0,0,255))
draw.SimpleTextOutlined(tostring(agendaText), "SmallFont", _wMod*16, _hMod*35, Color(255,255,255,255),TEXT_ALIGN_LEFT, TEXT_ALIGN_LEFT, 1 , Color(0,0,0,255))
end
end)
end
[/code]
If there is anything else you may need to help me please let me know.
Make sure DarkRPVar( "agenda" ) isn't nil
[QUOTE=code_gs;49259622]Make sure DarkRPVar( "agenda" ) isn't nil[/QUOTE]
Thank you for your reply, I fixed it.
Sorry, you need to Log In to post a reply to this thread.