.Smile
Member
- Joined
- Jan 27, 2019
- Messages
- 29
- Reaction score
- 11
Hello everyone, I am currently a beginner in programming and I am developing a Server, and one of the difficulties I had was to have to alternate between 2 Characters one PLAYER and the other GOD to test some things.
It is a very simple script, and in the future I intend to improve it.
What does the command do?
/adm - turns your character into GOD and kick him
/player - turns your character into PLAYER and kick him
REMEMBER THAT: It is not everyone who can use this command, you must have your account god access, so you can have this command on an Online Server with other players without them can use.
\data\talkactions\talkactions.xml
\data\talkactions\scripts\adm.lua
\data\talkactions\scripts\player.lua
It is a very simple script, and in the future I intend to improve it.
What does the command do?
/adm - turns your character into GOD and kick him
/player - turns your character into PLAYER and kick him
REMEMBER THAT: It is not everyone who can use this command, you must have your account god access, so you can have this command on an Online Server with other players without them can use.
\data\talkactions\talkactions.xml
XML:
<talkaction words="/player" script="player.lua" />
<talkaction words="/adm" script="adm.lua" />
\data\talkactions\scripts\adm.lua
Lua:
function onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local position = player:getPosition()
player:setGroup(Group(3))
position:sendMagicEffect(14)
player:remove()
return false
end
\data\talkactions\scripts\player.lua
Lua:
function onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local position = player:getPosition()
player:setGroup(Group(1))
position:sendMagicEffect(13)
player:remove()
return false
end
Last edited by a moderator: