I have been experimenting with the info.lua file and am now stuck at one point where it says "Invalid handler for command /ping, command will not be registered." I have added the handler for the command as "PingPlayer" and written the handler out in ping.lua. Below I added my info.lua and ping.lua files. (Note: all other commands + Handlers work). What's the issue? Thanks.
INFO.LUA g_PluginInfo = { Name = "Basics", Version = "0.1", Description = "Adds some basic commands", Commands = { ["/heal"] = { Permission = "basic.heal", HelpString = " Heal player to full health.", Handler = HealPlayer, }, ["/ping"] = { Permission = "basic.ping", HelpString = " Get a players ping to the server.", Handler = PingPlayer, }, ["/feed"] = { Permission = "basic.feed", HelpString = " Feed player to full hunger.", Handler = FeedPlayer, }, }, }
ping.lua function PingPlayer(Split, Player) if Split[2] == nil then Player:SendMessageSuccess(Player:GetClientHandle():GetPing()) elseif(Player:HasPermission("basics.ping.other")) then local Ping = function(OtherPlayer) if (OtherPlayer:GetName() == Split[2]) then Player:SendMessageSuccess("Player " .. Split[2].."ping: " .. OtherPlayer:GetClientHandle():GetPing()) return true end end if (not(cRoot:Get():FindAndDoWithPlayer(Split[2], Ping))) then Player:SendMessageFailure("Player not found.") end end return true end