# function findPlayerByName(playerPart)
local pl = getPlayerFromName(playerPart)
if isElement(pl) then
return pl
else
for i,v in ipairs (getElementsByType ("player")) do
if (string.find(getPlayerName(v),playerPart)) then
return v
end
end
end
end
function no(playerSource, command, arg1)
local playerElement = findPlayerByName(arg1)
if playerElement then
local name = getPlayerName(playerElement)
local sourceName = getPlayerName(playerSource)
outputChatBox (sourceName..": No way, " ..name.." !", getRootElement(), 0, 0, 5, true)
else
local sourceName = getPlayerName(playerSource)
outputChatBox (sourceName.." to himself: No way!", getRootElement(), 0, 0, 5, true)
end
end
addCommandHandler ("n", no)
and error
ERROR: newbi-scripts/untlited 10.lua:8 bad argument #2 to 'find' (string expected, got nil)
hope it help
else not working