Hey guys. I'm trying to make a command to rename. Like i type in [QUOTE]/rename xrayhunter bob[/QUOTE]
Which would target "xrayhunter" then turn it to the name "bob" in the scoreboard everything.
I got a bit head on this but. I can't turn my name to Bob.
[code]
hook.Add( 'PlayerSay', 'Commands', function( ply, text, isteam )
text = string.lower( text )
if ply:IsAdmin() or ply:IsSuperAdmin() then
if ( string.sub( text, 1, 8 ) == "/rename") then
text = string.Explode( " ", text )
local victim = FindPlayers( text[2] )
if ( IsValid( victim ) ) then
victim:SetName("Bob")
end
end
end)
[/code]
The only problem is its not giving the name. And i don't know how to set it that i can pick up the third argument
Sorry, you need to Log In to post a reply to this thread.