• New to GLua
    6 replies, posted
Ok so what the code is suppose to do is kick a player when requested [CODE] function RegisterConsoleCommand(name, func) concommand.Add("ssb_" .. name, func) MsgN("ssb_" .. name .. " has been sucessfully registered.") end RegisterConsoleCommand("kick",function(who, reason) if reason == "" then ssb.LogAPI.CommandMessage("kick", "You need to specify a reason!") end if who == "" then ssb.LogAPI.CommandMessage("kick", "You need to specify a player!") end who:Kick(reason) ssb.LogAPI.Action("Kicked " .. who:Nick() .. "[" .. who:SteamID() .. "]" .. " for " .. reason) end) [/CODE] it returns this [CODE] [ERROR] addons/space/lua/autorun/console/commandreg.lua:9: attempt to call method 'Kick' (a nil value) 1. unknown - addons/space/lua/autorun/console/commandreg.lua:9 2. unknown - lua/includes/modules/concommand.lua:54 [/CODE] -EDIT- Found a part where the it would error before it reached [CODE] ssb.LogAPI.Action("Kicked " .. v:Nick() .. "[" .. v:SteamID() .. "]" .. " for " .. reason) [/CODE] changed to [CODE] ssb.LogAPI.Action("Kicked " .. who:Nick() .. "[" .. who:SteamID() .. "]" .. " for " .. reason) [/CODE]
Kick only works serverside.
Hmmmmm then how would i call it in game, im so confused lol
[QUOTE=DiscoKnight;48441276]Hmmmmm then how would i call it in game, im so confused lol[/QUOTE] I'm saying the physical Player.Kick function is serverside only. Wrap it with a serverside check
[QUOTE=code_gs;48441342]I'm saying the physical Player.Kick function is serverside only. Wrap it with a serverside check[/QUOTE] so then [CODE] if SERVER then --Code end [/CODE]
Yes.
Ah thanks!
Sorry, you need to Log In to post a reply to this thread.