Sup, Zombie again,
was feeling bored and thought why not spice bot names up a bit, so i wrote this
[CODE]function ChangeBotName( ply )
if not ply:IsBot() then return end
for k,v in pairs(player.GetBots()) do
v:SetName("Bob the Tester")
end
end
hook.Add("PlayerInitialSpawn", "ChangeBotName", ChangeBotName)[/CODE]
the problem is that it doesn't work, and i have no idea what could be wrong.
all help welcome, thanks in advance
SetName doesn't set the actual [URL="http://wiki.garrysmod.com/page/Player/Nick"]"Nick"[/URL] of the bot. SetName sets the entity name, which can be obtained using [URL="http://wiki.garrysmod.com/page/Entity/GetName"]GetName[/URL].
so what do you suggest ? this doesn't work either
[CODE]function ChangeBotName( ply )
if not ply:IsBot() then return end
for k,v in pairs(player.GetBots()) do
v:Nick("Bob the Tester")
--or--
v:Nick() = "Bob the Tester"
end
end
hook.Add("PlayerInitialSpawn", "ChangeBotName", ChangeBotName)[/CODE]
[LUA]
local meta = FindMetaTable( "Player" )
local oldn = meta.Nick
function meta:Nick()
if self:IsBot() then return "Bob the Tester" end
return oldn( self )
end
[/LUA]
alright,this is good now,
[CODE]Client "Bob the Tester" spawned in server (BOT)<BOT>.[/CODE]
but i still see "bot01" in my scoreboard, ulx menu and console command "status", is it possible to change those value's to ?
[QUOTE=timmybo5;44961249]alright,this is good now,
[CODE]Client "Bob the Tester" spawned in server (BOT)<BOT>.[/CODE]
but i still see "bot01" in my scoreboard, ulx menu and console command "status", is it possible to change those value's to ?[/QUOTE]
Do the same but on the client.
[QUOTE]Do the same but on the client.[/QUOTE]
alright that fixed it for ULX, now "status"
You can't do it for 'Status' as that's a source engine command.
[QUOTE]You can't do it for 'Status' as that's a source engine command.[/QUOTE]
ah that sucks
Alternatively, you may be interested in this feature in the next update.
[url]http://facepunch.com/showthread.php?t=1374457&p=44951315&viewfull=1#post44951315[/url]
Sorry, you need to Log In to post a reply to this thread.