add_tutor.lua

main 22 lines · 676 bytes Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1function onSay(player, words, param)
2 if player:getGroup():getId() < 3 then
3 return false
4 end
5
6 local target = Player(param)
7 if not target then
8 player:sendCancelMessage("A player with that name is not online.")
9 return false
10 end
11
12 if target:getAccountType() ~= ACCOUNT_TYPE_NORMAL then
13 player:sendCancelMessage("You can only promote a normal player to a tutor.")
14 return false
15 end
16
17 target:setAccountType(ACCOUNT_TYPE_TUTOR)
18 target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been promoted to a tutor by " .. player:getName() .. ".")
19 player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have promoted " .. target:getName() .. " to a tutor.")
20 return false
21end
22
Top