Change playersToPM and huntingLocation
lua code:
-- PM when attacked by PK
--Version 1.0
--[[ Made by
___ .__ __. ______ ____ ____ .__ __.
/ \ | \ | | / __ \ \ \ / / | \ | |
/ ^ \ | \| | | | | | \ \/ / | \| |
/ /_\ \ | . ` | | | | | \_ _/ | . ` |
/ _____ \ | |\ | | `--' | | | | |\ |
/__/ \__\ |__| \__| \______/ |__| |__| \__|
]]
--------------------------------------------
--[[ ------------ CONFIG -------------- ]]--
--------------------------------------------
--This is where you say you are in the PM
huntingLocation = "Mt Sternum"
--This is who you will PM
playersToPM = {
"Rage",
"Tim"
}
--These are what you may say
helpMessages = {
"Help im being attacked at " .. huntingLocation .. " by ",
"PK at " .. huntingLocation .. "!!! fast compadre! ",
"PLs men, pk at " .. huntingLocation .. "!?! stronk men is named ",
"Im scurred and cold,,, at " .. huntingLocation .. "! keal the pk known as ",
"PK at " .. huntingLocation .. ". "
}
--------------------------------------------
--[[ ----- Script -- No need to edit ---- ]]
--------------------------------------------
function sendPMs( attacker )
for i = 1, #playersToPM do
local messageToUse = math.random(1,#helpMessages)
Self.PrivateMessage( playersToPM[i], helpMessages[messageToUse] .. attacker )
--Delay to pm more
wait(2300,6000)
end
end
playersAttackedMe = {}
function messageProxyCallback(proxy, message)
--Creature hits say by a
--Player hits say by
--If a player hit us
if( not string.find( message, "by a ") ) then
--get the starting index of their name
start, finish = string.find( message, "by ")
--Split the string at the finish of by_ + 1
local playerName = string.sub(message, finish + 1)
--Get the length of the player message
local stringLength = string.len(playerName)
--Cut the . off the string
playerName = string.sub(playerName, 0, stringLength - 1 )
--Check if i already PM'd about this pk
if( not table.find(playersAttackedMe, playerName, false) ) then
--add pk to attacked me list
playersAttackedMe[#playersAttackedMe+1] = playerName
--Dont instantly pm
wait(3000,4000)
sendPMs( playerName )
end
end
end
BattleMessageProxy.OnReceive("BattleMessageProxy", messageProxyCallback)