i get errors when running this script :
[LUA]
-- Incognito By Meisno and the CG Dev Team.
-- Enjoy !
local names = { }
local function ChooseRandomName( pl, bool )
if !names[ pl ] then names[ pl ] = { } end
local tab = names[ pl ]
if !tab.Original then tab.Original = pl:Nick() end
if bool then
local function Retry( ply )
local tab2 = player.GetAll()
local tab4 = table.remove( tab2, ply )
return table.Random( tab4 )
end
tab.FurName = Retry( pl )
return tab.FurName
else
return tab.Orignial
end
end
function _R.Player:Nick()
return ChooseRandomName( self, self:GetNWBool( 'Incognito' ) )
end
if SERVER then
concommand.Add( "Incognito_Activate", function( pl )
if pl:IsAdmin() then
pl:SetNWBool( 'Incognito', true )
end
end)
concommand.Add( "Incognito_Disactivate", function( pl )
if pl:IsAdmin() then
pl:SetNWBool( 'Incognito', false )
end
end)
hook.Add( "PlayerInitialSpawn", "Incognito.Debug:Names", function( pl )
pl:SetNWBool( 'Incognito' , false )
end)
end
-- ReDo aliases of Player.Nick
function _R.Player:Name()
return self:Nick()
end
function _R.Player:GetName()
return self:Nick()
end
[/LUA]
errors :
[CODE]
Hook 'CGAM.Plugin.UTime' Failed: lua\autorun\incognito.lua:24: stack overflow
Hook 'NAMETAGS_ADD' Failed: lua\autorun\incognito.lua:24: stack overflow
Hook 'CallThisFunx' Failed: lua\autorun\incognito.lua:24: stack overflow
[/CODE]
btw : filename is incognito.lua
OHHHHHH
okai
[editline]02:24PM[/editline]
how would i go arround fixing it?
[editline]02:24PM[/editline]
cause i cant seem to think straight about it o.0
[LUA]if !tab.Original then tab.Original = tab end[/LUA]
at line 9 because tab is the original name at that point.
At top of file
[lua]
local oldNick = _R.Player.Nick
[/lua]
And in your ChooseRandomName function
[lua]
if !tab.Original then tab.Original = oldNick(pl) end
[/lua]
Sorry, you need to Log In to post a reply to this thread.