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

MoveEvent Revised Square Trainer - Removes Soul & Teleports Player to Temple When Soul = 0

this is a good script but cant you use training monks and have, a tile you stand on to remove soul? so they choose what they train in with what weapon they have not just train in everything?
 
Very good script but now already not a lot otsów is using anti bot because want to have as the most players.
 
kool :)
shortttt
:p i wonder why many returns false
Lua:
--[[ 
Square Skill Trainer made by Arthur aka artofwork
This script will train all of a players skills indefintely
It has a small configuration setup where you can set the number of tries per skill
The time interval in between each skill try added
A storage value to help prevent abuse
You can assign any tile you wish to this script that a player can walk on with action id 900
Added a time check based on how much soul they have left
Example:
19:32 Luceria, you have enough soul points to train for 1 hour and 10 minutes
19:32 Your training session will begin in 30 seconds
19:32 Your training session will begin in 20 seconds
19:33 Your training session will begin in 10 seconds
19:33 Your training session will now begin
]]--

-- Config --
local soul = 1 -- the amount of soul to take
local storage = 18010-- Storage value for the player when he steps on and off the tile
local amount = 0 -- the minimum soul they need to use trainers
local skilltries = 1 -- Number of tries per skill
local t = 4000   -- Set the time before try is added to skills (4 seconds)

-- temple x, y, z coordinates set in config.lua --
local mposx = getConfigInfo('newPlayerSpawnPosX') 
local mposy = getConfigInfo('newPlayerSpawnPosY') 
local mposz = getConfigInfo('newPlayerSpawnPosZ')
local ACCESS_TO_USE = 0
local TEMPLE_POS = {x = mposx, y = mposy, z = mposz}
-------------------------------------------------------------------------

function timeCheck(p)
    local hour = math.floor(getPlayerSoul(p.cid) / 60)
    local minutes = getPlayerSoul(p.cid) % 60
    if getPlayerSoul(p.cid) > 120 then
        doPlayerSendTextMessage(p.cid, 22, getCreatureName(p.cid)..', you have enough soul points to train for '.. hour ..' hours and '.. minutes ..' minutes')
    elseif getPlayerSoul(p.cid) == 120 then
        doPlayerSendTextMessage(p.cid, 22, getCreatureName(p.cid)..', you have enough soul points to train for '.. hour ..' hours.')
    elseif getPlayerSoul(p.cid) > 60 and getPlayerSoul(p.cid) < 120) then
        doPlayerSendTextMessage(p.cid, 22, getCreatureName(p.cid)..', you have enough soul points to train for '.. hour ..' hour and '.. minutes ..' minutes')
    elseif getPlayerSoul(p.cid) == 60 then
        doPlayerSendTextMessage(p.cid, 22, getCreatureName(p.cid)..', you have enough soul points to train for '.. hour ..' hour.')
    else
        doPlayerSendTextMessage(p.cid, 22, getCreatureName(p.cid)..', you have enough soul points to train for '.. minutes ..' minutes')
    end
end

function templeTeleport(p)
     if getPlayerAccess(p.cid) >= ACCESS_TO_USE then
        doCreatureSetStorage(p.cid, storage, 0)
        doSendMagicEffect(getThingPos(p.cid), CONST_ME_TELEPORT)
        doTeleportThing(p.cid, TEMPLE_POS)
        doSendMagicEffect(TEMPLE_POS, CONST_ME_ENERGYAREA)
     else
        doPlayerSendCancel(p.cid,'You don\'t have access to do this.')
     end
end

function takeSoulPoints(p)
    if getPlayerSoul(p.cid) > amount then
        doPlayerAddSoul(p.cid, -p.soul)
        p.seconds = 60000
    else
        doPlayerSendTextMessage(p.cid,22,'Sorry '.. getCreatureName(p.cid) ..', you do not have enough soul points to train.')
        addEvent(templeTeleport, 1, p)
    end
end 
     
function trainerthree(p)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        doPlayerSendTextMessage(p.cid, 22, 'Your training session will begin in 30 seconds')
        addEvent(trainertwo, 10 * 1000, p)
    end
    return false
end
 
function trainerthree(p)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        doPlayerSendTextMessage(p.cid, 22, 'Your training session will begin in 20 seconds')
        addEvent(trainerone, 10 * 1000, p)
    end
    return false
end
 
function trainerone(p)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        doPlayerSendTextMessage(p.cid, 22, 'Your training session will begin in 10 seconds')
        addEvent(readyToTrain, 10 * 1000, p)
    end
    return false
end
 
function readyToTrain(p)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        doPlayerSendTextMessage(p.cid, 22, 'Your training session will now begin')
        doPlayerAddSoul(p.cid, -p.soul)
        addEvent(trainMeA, t, p)
    end
    return false
end
 
function trainMeA(p)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        for i = 0, 5 do
            doPlayerAddSkillTry(p.cid, i, skilltries)
        end
    if p.seconds <= 1000 then
        addEvent(takeSoulPoints, 1 * 1000, p)
    end
    p.seconds = p.seconds - t
    addEvent(trainMeB, t, p)
    end
    return false
end
 
function trainMeB(p)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        for i = 0, 5 do
            doPlayerAddSkillTry(p.cid, i, skilltries)
        end
    if p.seconds <= 1000 then
        addEvent(takeSoulPoints, 1 * 1000, p)
    end
    p.seconds = p.seconds - t
    addEvent(trainMeA, t, p)
    end
    return false
end
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    local seconds = 60000
    local p = {cid = cid, item = item, pos = pos, soul = soul, seconds = seconds}
    doCreatureSetStorage(p.cid, storage, 1)
    if isPlayer(p.cid) and getCreatureStorage(p.cid, storage) == 1 then
        if p.item.actionid == 900 and getPlayerSoul(p.cid) > amount then
            timeCheck(p)
            addEvent(trainerthree, 1 * 1000, p)
        else
            addEvent(takeSoulPoints, 1, p)
        end
    end
    return false
end
 
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if isPlayer(cid) then
        doCreatureSetStorage(cid, storage, 0)
        doPlayerSendTextMessage(cid, 22, 'Your training session has now ended')
    end
    return true
end
 
To bad every version of the TFS i have tryed this with doesn't throw any error's just causes the server to go into a mad debug frenzy
 
Nice I Will try that some day
zhao3.jpg
zhao2.jpg
zhao4.jpg
 
Just tested this out on TFS and it works like a freaking charm. (crying damson). This is exactly what I was looking for and works seamlessly beyond my imagination.
You sir get a rep from me and all of my praise.
 
Back
Top