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

RevScripts Convert script to tfs 1.3

jel

Member
Joined
Mar 22, 2014
Messages
302
Reaction score
12
could someone convert this script to tfs 1.3?
system to check if the player is with bless

C++:
function onThink(cid, lastExecution, thinkInterval)
    if(getTilePzInfo(getCreaturePosition(cid))) == false and getPlayerStorageValue(cid, 23333) <= 0 then
        for i = 1,8 do
            if getPlayerBlessing(cid,8) == false then
           setPlayerStorageValue(cid, 23333, 1)
           return doPlayerSendTextMessage(cid, 22, "Voce não tem todas as bless, tome cuidado.")
        else
           setPlayerStorageValue(cid, 23333, 1)
           return doPlayerSendTextMessage(cid, 22, "Voce tem todas as bless.")
            end
        end
    elseif (getTilePzInfo(getCreaturePosition(cid))) == true and getPlayerStorageValue(cid, 23333) == 1 then
        setPlayerStorageValue(cid, 23333, -1)
    end
   return true
end
 
Solution
nothing happens and no errors in the log

Check this, im not good "scripter", but it working on tfs 1.5, without your get/set storages cuz i don't know what it do in your script
i think, your script sending message to player if he dont has bless and he is out a PZ area, so there is same in more easy formula
Btw put it in data/scripts folder


Lua:
local lazyPeopleNowDays = GlobalEvent("Lazy")
function lazyPeopleNowDays.onThink(interval)
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        if not targetPlayer:getTile():hasFlag(TILESTATE_PROTECTIONZONE) then
            for i = 1, 5 do
                if targetPlayer:hasBlessing(i) then
                    return true
                end
            end...
Lua:
local lazyPeopleNowDays = GlobalEvent("Lazy")

Lua:
function lazyPeopleNowDays.onThink

Lua:
lazyPeopleNowDays:interval(1000)
lazyPeopleNowDays:register()
 
convert tfs 1.3?

@Levi999x gived u all what u need to "convert" it xD

Lua:
local lazyPeopleNowDays = GlobalEvent("Lazy")
function lazyPeopleNowDays.onThink(cid, lastExecution, thinkInterval)
    if(getTilePzInfo(getCreaturePosition(cid))) == false and getPlayerStorageValue(cid, 23333) <= 0 then
        for i = 1,8 do
            if getPlayerBlessing(cid,8) == false then
           setPlayerStorageValue(cid, 23333, 1)
           return doPlayerSendTextMessage(cid, 22, "Voce não tem todas as bless, tome cuidado.")
        else
           setPlayerStorageValue(cid, 23333, 1)
           return doPlayerSendTextMessage(cid, 22, "Voce tem todas as bless.")
            end
        end
    elseif (getTilePzInfo(getCreaturePosition(cid))) == true and getPlayerStorageValue(cid, 23333) == 1 then
        setPlayerStorageValue(cid, 23333, -1)
    end
   return true
end

lazyPeopleNowDays:interval(1000)
lazyPeopleNowDays:register()
 
@Levi999x gived u all what u need to "convert" it xD

Lua:
local lazyPeopleNowDays = GlobalEvent("Lazy")
function lazyPeopleNowDays.onThink(cid, lastExecution, thinkInterval)
    if(getTilePzInfo(getCreaturePosition(cid))) == false and getPlayerStorageValue(cid, 23333) <= 0 then
        for i = 1,8 do
            if getPlayerBlessing(cid,8) == false then
           setPlayerStorageValue(cid, 23333, 1)
           return doPlayerSendTextMessage(cid, 22, "Voce não tem todas as bless, tome cuidado.")
        else
           setPlayerStorageValue(cid, 23333, 1)
           return doPlayerSendTextMessage(cid, 22, "Voce tem todas as bless.")
            end
        end
    elseif (getTilePzInfo(getCreaturePosition(cid))) == true and getPlayerStorageValue(cid, 23333) == 1 then
        setPlayerStorageValue(cid, 23333, -1)
    end
   return true
end

lazyPeopleNowDays:interval(1000)
lazyPeopleNowDays:register()
nothing happens and no errors in the log
 
nothing happens and no errors in the log

Check this, im not good "scripter", but it working on tfs 1.5, without your get/set storages cuz i don't know what it do in your script
i think, your script sending message to player if he dont has bless and he is out a PZ area, so there is same in more easy formula
Btw put it in data/scripts folder


Lua:
local lazyPeopleNowDays = GlobalEvent("Lazy")
function lazyPeopleNowDays.onThink(interval)
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        if not targetPlayer:getTile():hasFlag(TILESTATE_PROTECTIONZONE) then
            for i = 1, 5 do
                if targetPlayer:hasBlessing(i) then
                    return true
                end
            end
            targetPlayer:sendTextMessage(MESSAGE_EVENT_ORANGE, "You are not Blessed!")
            return true
        end
    end
    return true
end

lazyPeopleNowDays:interval(2000)
lazyPeopleNowDays:register()
 
Solution
Back
Top