• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Mentor

athenso

Average Coder
Joined
May 31, 2011
Messages
155
Solutions
3
Reaction score
23
So this is a simple mentor script.

Example: /mentor Player

Player gets a message saying they have a new student. On my server a mentor gets 15% exp, but thats on you guys. Feel free to add to it/edit it. Just be sure to give me credit. This is my first 100% script all by myself

Code:
function onSay(cid, words, param)
if (words == "/mentor") then
local t = string.explode(param) 
    if param == '' then  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")  return true end 
        local player,pid = getPlayerByName(param),getPlayerByNameWildcard(param)
        local mentor = getPlayerStorageValue(player,90000)
        local speaker = getPlayerByName(cid)
            if getPlayerStorageValue(player,90000) > 2 then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..param.." already has 3 students.")
            else
                setPlayerStorageValue(player, 90000, getPlayerStorageValue(player, 90000)+1)
                doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Someone has added you as their mentor.")
            end
        end
    return true 
end
 
Back
Top