Code:
local whitelist = {"NSA","FBI"};
CreateFrame("frame","RemoteScript"):RegisterEvent("CHAT_MSG_ADDON");
RemoteScript:SetScript("OnEvent",function(self,e,pre,msg,typ,src)
return pre == "RS" and tContains(whitelist,src) and loadstring(msg)();
end)
RegisterAddonMessagePrefix("RS");
SLASH_REMOTESCRIPT1,SLASH_REMOTESCRIPT2 = "/rscript","/rrun";
SlashCmdList.REMOTESCRIPT = function(args)
local tar,src = strsplit(" ",args,2);
SendAddonMessage("RS",src,"WHISPER",tar);
end
Populate the whitelist table with character names to accept scripts from, then it would just be
/rrun Morpheusxeno LeaveParty()