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

TalkAction Very fun Script for GODs

antoniolagos

Member
Joined
Apr 10, 2010
Messages
34
Reaction score
6
Hello dear friends:

In my experience, being a player is more funny than being a GOD, but sometimes you need the GOD to put some things in order. So you have to login as player, then as god and viceversa, making it very boring. I have the solution for this problem. With this talkaction you can turn your God into Player and then can turn this player into GOD again. You only have to say with god "/godplayer on" and you will turn into normal Player (with god outfit), so people can even kill you (people will do, believe me). Then you can turn back into GOD by saying "/godplayer off".


Benefits of this talkaction:

  • Enjoy your ot with your God (when you are /godplayer on, you can die, lose experience, level up, skill up, and all that a normal player can do).
  • GOD will not suck anymore.
  • Players in your OT can see you as equal. Humble people are the biggest one, so you will be a better member of your ot.
  • You can have adventures with your players, make quests, etc. If you are tired of being a player, just say /godplay off and you will turn into GOD again.


Disadvantages:

  • Some players will think you are edited, even if you are not.
  • Killing GODs is very funny, so people will attack you, surely.


Well dear friends, this is the talkaction, tested in TFS 8.6 (I have not tested in any other version). Is very easy to set up.

In talkactions.xml put this:

<talkaction words="/godplayer;!godplayer" event="script" value="godplayer.lua"/>

Then in folder data/talkactions/scripts put a file called godplayer.lua and copy this code inside:

Code:
function onSay(cid, words, param)
local storage = 121212
local staff = getPlayerGroupId(cid)   
local storage1 = getPlayerStorageValue(cid,storage)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
elseif getPlayerGroupId(cid) >= 2 and param == "on" then
setPlayerStorageValue(cid,storage,staff)
doPlayerSetGroupId(cid,1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are a PLAYER now. Enjoy!")

elseif storage1 >= 2 and param == "off" then
doPlayerSetGroupId(cid,storage1)
doPlayerSetStorageValue(cid,storage,1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are a GOD now.")

elseif (getPlayerGroupId(cid) >= 2 and param == "off") or (storage1 >= 2 and param == "off") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already a player.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Only staff members can use this command.")
end
end

Well, this is all my humble colaboration. Have fun dear friends. Hail Tibia!
 

Attachments

There's no point to having the on/off param, since it's basically just a toggle state.

Same script as OP's, but without the param's.
Lua:
local storage = 121212
function onSay(cid, words, param)
    local storage_value = getPlayerStorageValue(cid, storage)
    local group_id = getPlayerGroupId(cid)
    if group_id > 1 then
        doPlayerSetGroupId(cid, 1)
        setPlayerStorageValue(cid, storage, group_id)        
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are a PLAYER now. Enjoy!")
    elseif storage_value > 1 then
        doPlayerSetGroupId(cid, storage_value)
        doPlayerSetStorageValue(cid, storage, -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are a GOD now.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Only staff members can use this command.")
    end
    return true
end
 
With help from @Xikini the script is updated if anyone wants to use it.

Only tested it TFS 1.3

Command /godchar , !g,
does not show msg in local chat for others only you can see it.

all cred to @Xikini for the fix.

Lua:
local storage = 121213

local talk = TalkAction("/godchar", "!g")

function talk.onSay(player, words, param)
    local storageValue = player:getStorageValue(storage)
    local group = player:getGroup()
    if group:getAccess() then
        player:setStorageValue(storage, group:getId())
        player:setGroup(Group(1))
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are a PLAYER now. Enjoy!")
        return false
    elseif storageValue > 1 then
        player:setStorageValue(storage, -1)
        player:setGroup(Group(storageValue))
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are a GOD now.")
        return false
    end
    return true
end

talk:separator(" ")
talk:register()
 
Back
Top