local money = 100 --money in gp
function onKill(cid,target, lastHit)
if isPlayer(cid) and isPlayer(target) then --checks if the one that is attacking is a player, and checks if the one being attackes is a player
if lastHit then --checks if this is the last hit killer
doPlayerAddMoney(cid,money) -- this add the money to the player in gp's value
doPlayerSendTextMessage(cid,22,"You have got "..money.." gp for killing "..getCreatureName(target)..".")
--In this line there is some stuff.
--First this function send a message to the player(cid) and it is a orange message in console (as the "22" state the msg class)
-- Second we write the message in "" .
-- What about those ".. money.." and "..getCreatureName(target).."??
--Okay we as in our message we want the player to know how money he got , and this value is assigned to the local varible money..
--To get its value as a string, we use the string concatenation operator(..).
-- like that we stated that ..money.. will be copyied from the varible money as a string that can be output as a message.
-- As for "..getCreatureName(target).." this to get the player killed name :), we put in concatenation operator to state it not to be typed as it is as a messgae but it get the data as string. :p
end --each if has an end
end
return true
end