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

TFS 1.X+ how can i change this script 0.4 to OTX 1.3?

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,210
Solutions
35
Reaction score
206
script 1: change vocation item
Code:
function onUse(cid, item, frompos, item2, topos)
local outfit1 = {lookType = 250}

    if getPlayerVocation(cid) == 660 then
        doPlayerSendTextMessage(cid,22,"You are master knight.")
    return true
    end


    if item.itemid == 11411 then
        doRemoveItem(item.uid,1)
        doCreatureChangeOutfit(cid, outfit1)
        doPlayerSetVocation(cid,660)
        doPlayerSendTextMessage(cid,22,"Now you are a master knight.")
    end
return true
end

script 2: teleport scroll
Code:
function onUse(cid, item)

if item.itemid == 5952 then
    if getTileInfo(getCreaturePosition(cid)).pvp then
        return doPlayerSendCancel(cid, "Cant tp in pvp area!")
    elseif getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE then
        return doPlayerSendCancel(cid,"Cant tp with fight!")
    end


doRemoveItem(item.uid, 1)
doTeleportThing(cid, {x=1040, y=894, z=5})
doSendMagicEffect(getThingPos(cid), 10)
end
return true
end
 
script 1 = changevocation.lua

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local voc = vocationid of master knight
local itemid = Id of the item the player needs to have
local outfit1 = 250

    if player:getVocation() == voc then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are master knight.")
    return true
    end


    if player:getItemCount(itemid, -1) >= 1 then
        player:removeItem(itemid, 1, -1, false)
        creature:setOutfit(outfit1)
        player:setVocation(voc)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Now you are a master knight.")
    end
return true
end
 
script 1 = changevocation.lua

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local voc = vocationid of master knight
local itemid = Id of the item the player needs to have
local outfit1 = 250

    if player:getVocation() == voc then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are master knight.")
    return true
    end


    if player:getItemCount(itemid, -1) >= 1 then
        player:removeItem(itemid, 1, -1, false)
        creature:setOutfit(outfit1)
        player:setVocation(voc)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Now you are a master knight.")
    end
return true
end

Lua Script Error: [Action Interface]
data/actions/scripts/vocmasterkina.lua:onUse
data/actions/scripts/vocmasterkina.lua:14: attempt to index global 'creature' (a nil value)
stack traceback:
[C]: in function '__index'
data/actions/scripts/vocmasterkina.lua:14: in function <data/actions/scripts/vocmasterkina.lua:1>
 
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local voc = vocationid of master knight
local itemid = Id of the item the player needs to have
local outfit1 = 250
local player = Player(cid)

    if player:getVocation() == voc then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are master knight.")
    return true
    end

    if player:getItemCount(itemid, -1) >= 1 then
        player:removeItem(itemid, 1, -1, false)
        player:setOutfit(outfit1)
        player:setVocation(voc)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Now you are a master knight.")
    end
return true
end
 
Back
Top