• 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!

[Script] Use xxxx item, your character is made a GM

Creon01001

New Member
Joined
Aug 20, 2011
Messages
10
Reaction score
0
The title basically says it all, I would like a script that makes you a GM when you use a certain item.
If this isn't possible, maybe you could make a talk action that does this.
If that's even not possible, how can I make myself a gm without doing that thing on the internet.

Thanks in advance,
Creon
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local group = getPlayerGroupId(cid)
local newgroup = 3
if isPlayer(cid) and group == 1 then
doPlayerSetGroupId(cid, newgroup)
doPlayerSendTextMessage(cid,25,"Congratulations, you are now a god.")
doPlayerRemoveItem(uid, 1)
elseif not isPlayer or group >= 2 then
doPlayerSendTextMessage(cid,25,"You are already a god.")
end
return true
end
 
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if getPlayerGroupId(cid) > 1 then
           doPlayerSendCancel(cid, "You have been demoted to player.")
           doPlayerSetGroupId(cid, 1)
     elseif getPlayerGroupId(cid) < 3 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 3)
     end
     return true
end
 
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if getPlayerGroupId(cid) > 1 then
           doPlayerSendCancel(cid, "You have been demoted to player.")
           doPlayerSetGroupId(cid, 1)
     elseif getPlayerGroupId(cid) < 3 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 3)
     end
     return true
end

When I use the piece of paper, I get the words, but nothing else happens.
 
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if getPlayerGroupId(cid) > 1 then
           doPlayerSendCancel(cid, "You have been demoted to player.")
           doPlayerSetGroupId(cid, 1)
     elseif getPlayerGroupId(cid) < 3 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 3)
     end
     return true
end

That has nothing to do with what he wants >_>
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local group = getPlayerGroupId(cid)
local newgroup = 3
if isPlayer(cid) and group == 1 then
doPlayerSetGroupId(cid, newgroup)
doPlayerSendTextMessage(cid,25,"Congratulations, you are now a god.")
doPlayerRemoveItem(uid, 1)
elseif not isPlayer or group >= 2 then
doPlayerSendTextMessage(cid,25,"You are already a god.")
end
return true
end

@optus ur script makes the char a senior tutor

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local group = getPlayerGroupId(cid)
local newgroup = 4
if isPlayer(cid) and group == 1 then
doPlayerSetGroupId(cid, newgroup)
doPlayerSendTextMessage(cid,25,"Congratulations, you are now a god.")
doPlayerRemoveItem(uid, 1)
elseif not isPlayer or group >= 4 then
doPlayerSendTextMessage(cid,25,"You are already a god.")
end
return true
end

fixed :)
 
Last edited:
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) > 1 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
     end
     return true
end

??
 
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) > 1 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
     end
     return true
end

??

@up this would even make a god a GM :D

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) == 1 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
     end
     return true
end

now it works better
 
@up this would even make a god a GM :D

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) == 1 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
     end
     return true
end

now it works better

Why are you checking if its a player? And it would just make players with groupID 1, GMs.

Lua:
function onUse(cid)
return doPlayerSetGroupId(cid,4) and true
end
 
Why are you checking if its a player? And it would just make players with groupID 1, GMs.

Lua:
function onUse(cid)
return doPlayerSetGroupId(cid,4) and true
end

huh? check his script it was
Lua:
 if isPlayer(cid) and getPlayerGroupId(cid) > 1 then
so it would make any groupid a gm :S even higher ones
 
@up this would even make a god a GM :D

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) == 1 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
     end
     return true
end

now it works better

I keep getting the words, but nothing is happening. And yes I tried re-logging.

I am getting this message in the server window:
Code:
[04/09/2011 21:45:27] Lua Script Error: [Action Interface] 
[04/09/2011 21:45:27] data/actions/scripts/other/god.lua:onUse
[04/09/2011 21:45:27] data/actions/scripts/other/god.lua:4: attempt to call global 'doPlayerSetGroupId' (a nil value)
[04/09/2011 21:45:27] stack traceback:
[04/09/2011 21:45:27] 	[C]: in function 'doPlayerSetGroupId'
[04/09/2011 21:45:27] 	data/actions/scripts/other/god.lua:4: in function <data/actions/scripts/other/god.lua:1>
 
If you have your ot sources, could you post/upload luascript.cpp? So that we know if the function has another name in your server or if it even exist :eek:
 
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) > 1 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
     end
     return true
end

??

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) < 4 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
           doRemoveItem(item.uid)
     end
     return true
end

little fix
 
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
     if isPlayer(cid) and getPlayerGroupId(cid) < 4 then
           doPlayerSendCancel(cid, "You have been promoted to GM.")
           doPlayerSetGroupId(cid, 4)
           doRemoveItem(item.uid)
     end
     return true
end

little fix

already fixed it ;)
 
Back
Top