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

TSF 1.1 save problem!

jalllee

Member
Joined
May 5, 2009
Messages
41
Reaction score
9
Hello guys!

I have a problem on my server, i dont have any save commands. Have been playing ots for a couple of years so i know how to add talkaction etc, but it still doesnt work. Can say that i havent used TSF 1.1 before tho. Can anyone here who have gotten it worked please help me out.

Regards Jalllee
 
Solution
Code:
<talkaction words="/save" script="savecharacter.lua"/>

Code:
function onSay(player, words, param)
    player:save()
    return true
end

You are talking about saving the character right?
Otherwise you can use this to save the server:
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
  
    Game.broadcastMessage("Server save in 1 minute.")
    addEvent(saveServer, 1 * 60 * 1000)
    return false
end
Try this...
PHP:
local savingEvent = 0

function onSay(player, words, param)
    if player:getGroup():getAccess() then
        if isNumber(param) then
            stopEvent(savingEvent)
            save(tonumber(param) * 60 * 1000)
        else
            saveServer()
        end
    end
end

function save(delay)
    saveServer()
    if delay > 0 then
        savingEvent = addEvent(save, delay, delay)
    end
end
 
Still doesnt work. I have the following
Talkactions.xml
PHP:
    <talkaction words="/save" event="script" value="savecharacter.lua"/>
savecharacter.lua
PHP:
localsavingEvent = 0

function onSay(player, words, param)
    if player:getGroup():getAccess() then
        if isNumber(param) then
            stopEvent(savingEvent)
            save(tonumber(param) * 60 * 1000)
        else
            saveServer()
        end
    end
end

function  SAVE(delay)
    saveServer()
    if delay > 0 then
        savingEvent = addEvent(save, delay, delay)
    end
end
 
Code:
<talkaction words="/save" script="savecharacter.lua"/>

Code:
function onSay(player, words, param)
    player:save()
    return true
end

You are talking about saving the character right?
Otherwise you can use this to save the server:
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
  
    Game.broadcastMessage("Server save in 1 minute.")
    addEvent(saveServer, 1 * 60 * 1000)
    return false
end
 
Solution
Code:
<talkaction words="/save" script="savecharacter.lua"/>

Code:
function onSay(player, words, param)
    player:save()
    return true
end

You are talking about saving the character right?
Otherwise you can use this to save the server:
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
 
    Game.broadcastMessage("Server save in 1 minute.")
    addEvent(saveServer, 1 * 60 * 1000)
    return false
end
This worked fine for me. I had the same problem.
 
Back
Top