• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Change TFS 1.2 to OTX 0.3.7 - Script Lua Trainer

Forkz

Advanced OT User
Joined
Jun 29, 2020
Messages
586
Solutions
17
Reaction score
159
Can anyone turn this script into OTX 0.3.7?

LUA:
function onSay(player, words, param)
    local words = {'The training will makes me stronger!','Training time!','I will punch that monk!'}
    local choosed = math.random(1,#words)
    
    local playerPos = player:getPosition()
    if playerPos:isInRange({x=5990, y=6034, z=7}, {x=6008, y=6047, z=7}) then
        player:say(words[choosed], TALKTYPE_SAY)
        playerPos:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Welcome to training zone!")
        local newPos = Position(6078,6006,6)
        player:teleportTo(newPos)
        newPos:sendMagicEffect(CONST_ME_TELEPORT)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You're not in temple to use that command.")
    end
    return false
end
 
Solution
LUA:
function onSay(cid, words, param)
    local words = {'The training will makes me stronger!','Training time!','I will punch that monk!'}
    local choosed = math.random(1,#words)
    
    local playerPos = getCreaturePosition(cid)
    if isInRange(playerPos, {x=5990, y=6034, z=7}, {x=6008, y=6047, z=7}) then
        doCreatureSay(cid, words[choosed], TALKTYPE_SAY)
        doSendMagicEffect(playerPos, CONST_ME_POFF)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome to training zone!")
        local newPos = {x=6078, y=6006, z=6}
        doTeleportThing(cid, newPos, false)
        doSendMagicEffect(newPos, CONST_ME_TELEPORT)
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You're not in temple to use that...
LUA:
function onSay(cid, words, param)
    local words = {'The training will makes me stronger!','Training time!','I will punch that monk!'}
    local choosed = math.random(1,#words)
    
    local playerPos = getCreaturePosition(cid)
    if isInRange(playerPos, {x=5990, y=6034, z=7}, {x=6008, y=6047, z=7}) then
        doCreatureSay(cid, words[choosed], TALKTYPE_SAY)
        doSendMagicEffect(playerPos, CONST_ME_POFF)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome to training zone!")
        local newPos = {x=6078, y=6006, z=6}
        doTeleportThing(cid, newPos, false)
        doSendMagicEffect(newPos, CONST_ME_TELEPORT)
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You're not in temple to use that command.")
    end
    return false
end
 
Solution
Back
Top