I get it, it tried to use a null entity but why does it think it is a null entity?
"init.lua" ( under a player spawn hook )
ply:setFaction( "test" )
"functions/sh_factions.lua"
function meta:setFaction( faction )
if( tostring(faction) == nil ) then
scr_msg( "error", "Function 'setFaction' did not get a real value, needs to be a string." )
else
meta:SetNWString( "gmn_faction", tostring(faction) ) -- line 47
meta:setupFaction()
end
end
The error:
[ERROR] gamemodes/gamemodename/gamemode/functions/sh_factions.lua:47: attempt to call method 'GetNWString' (a nil value)
1. setupFaction - gamemodes/gamemodename/gamemode/functions/sh_factions.lua:47
2. setFaction - gamemodes/gamemodename/gamemode/functions/sh_factions.lua:36
3. unknown - gamemodes/gamemodename/gamemode/init.lua:44
4. Spawn - [C]:-1
5. unknown - gamemodes/base/gamemode/player.lua:115
Please help.
you sure its not gm_faction?
The error stacktrace is in setupFaction, but you've posted the code for setFaction.
(Also, tostring will never return nil)
Pretty sure yes.
You're using meta in the function, it should be self within the function
You are the real fucking MVP. Thanks!
Sorry, you need to Log In to post a reply to this thread.