Title was hard to word, but anyways.
I'm making a custom admin menu for my gamemode, but when I call "Kick()" is just gives me
[code]Attempt to call method "Kick" (a nil value)[/code]
Code is:
[lua] AcceptBtn.DoClick = function()
Reason:SetVisible(false)
PlayerList:GetSelectedItems()[1]:GetValue():Kick()
end[/lua]
PlayerList is a DComboBox which i've edited to list all players.
PlayerList is probably a list of player names, not player objects. You're trying to call :Kick() on a string.
Or maybe because derma is clientside and Kick() is serverside?
Well, that too :v:
you may can use
[lua]RunConsoleCommand("kick "..PlayerList:GetSelectedItems()[1]:GetValue():Nick())[/lua]to make it clientside
That wont work, you'd need to get the player entity and use kickid i believe. Also, that would only work in a listen server
Sorry, you need to Log In to post a reply to this thread.