local pos = {x = 1000, y = 1000, z = 7}
function onStepIn(cid, item, itemEx, frompos, topos)
if not doPlayerRemoveItem(cid, itemid, amount) then
doPlayerSendCancel(cid, "You dont have the coins")
doTeleportThing(cid, fromPos, true)
return false
else
doTeleportThing(cid, pos)
doPlayerRemoveItem(cid, itemid, amount)
end
end
local pos = {x = 1000, y = 1000, z = 7}
function onStepIn(cid, item, itemEx, frompos, topos)
if getPlayerStorageValue(cid, script_coin) < 100 then
doPlayerSendCancel(cid, "You do not have enough script coins.")
doTeleportThing(cid, fromPos, true)
else
doTeleportThing(cid, pos)
setPlayerStorageValue(cid, script_coin - 100)
end
end
local tpto = {x = 100, y = 100, z = 7}
local itemid = 2148
function onStepIn(cid, item, position, fromPosition)
if not(isPlayer(cid)) then return true end
if doPlayerRemoveItem(cid,itemid,100) then
doTeleportThing(cid, tpto)
doSendMagicEffect(tpto,10)
else
doPlayerSendTextMessage(cid,22, "Sorry, but it require 100 "..getItemName(itemid).." to enter here")
doSendMagicEffect(getThingPos(cid),10)
doTeleportThing(cid, fromPosition)
end
return true
end
when use this script tp me and don't loot if i have items or no " tp if i have items or no :S " just tp me :S and othere script gave me this Bugfunction onStepIn(cid, item, itemEx, frompos, topos)
if not doPlayerRemoveItem(cid, itemid, amount) then
doPlayerSendCancel(cid, "You dont have the coins")
doTeleportThing(cid, fromPos, true)
return false
else
doTeleportThing(cid, pos)
doPlayerRemoveItem(cid, itemid, amount)
end
end
[01/03/2013 19:38:01] [Error - MoveEvents Interface]
[01/03/2013 19:38:01] data/movements/scripts/bosstp.luanStepIn
[01/03/2013 19:38:01] Description:
[01/03/2013 19:38:01] attempt to index a nil value
[01/03/2013 19:38:01] stack traceback:
[01/03/2013 19:38:01] [C]: in function 'doTeleportThing'
[01/03/2013 19:38:01] data/movements/scripts/bosstp.lua:6: in function <data/movements/scripts/bosstp.lua:3>
local topos = {x = 1000, y = 1000, z = 7}
local cancel = "You need "..amount.." Script Coins to enter here"
local item = 2190
local amount = 100
function onStepIn(cid, item, position, fromPosition)
if doPlayerRemoveItem(cid, item, amount) and isPlayer(cid) then
doTeleportThing(cid, topos)
else
doPlayerSendCancel(cid, cancel)
doTeleportThing(cid, fromPosition)
end
return true
end
local tpto = {x = 100, y = 100, z = 7}
local itemid = 2148
function onStepIn(cid, item, position, fromPosition)
if not(isPlayer(cid)) then return true end
if doPlayerRemoveItem(cid,itemid,100) then
doTeleportThing(cid, tpto)
doSendMagicEffect(tpto,10)
else
doPlayerSendTextMessage(cid,22, "Sorry, but it require 100 "..getItemName(itemid).." to enter here")
doSendMagicEffect(getThingPos(cid),10)
doTeleportThing(cid, fromPosition)
end
return true
end
local topos = {x = 1000, y = 1000, z = 7}
local cancel = "You need 100 Script Coins to enter here"
local item = 2190
local amount = 100
function onStepIn(cid, item, position, fromPosition)
if doPlayerRemoveItem(cid, item, amount) and isPlayer(cid) then
doTeleportThing(cid, topos)
else
doPlayerSendCancel(cid, cancel)
doTeleportThing(cid, fromPosition)
end
return true
end
Try this:
LUA:local topos = {x = 1000, y = 1000, z = 7} local cancel = "You need 100 Script Coins to enter here" local item = 2190 local amount = 100 function onStepIn(cid, item, position, fromPosition) if doPlayerRemoveItem(cid, item, amount) and isPlayer(cid) then doTeleportThing(cid, topos) else doPlayerSendCancel(cid, cancel) doTeleportThing(cid, fromPosition) end return true end
and xmllocal topos = {x = 32339, y = 32222, z = 7}
local cancel = "You need 100 Script Coins to enter here"
local item = 2159
local amount = 100
function onStepIn(cid, item, position, fromPosition)
if doPlayerRemoveItem(cid, item, amount) and isPlayer(cid) then
doTeleportThing(cid, topos)
else
doPlayerSendCancel(cid, cancel)
doTeleportThing(cid, fromPosition)
end
return true
end
<movevent type="StepIn" actionid="77041" event="script" value="bosstp.lua"/>
local tpto = {x = 100, y = 100, z = 7}
local itemid = 2148
function onStepIn(cid, item, position, fromPosition)
if not(isPlayer(cid)) then return true end
if doPlayerRemoveItem(cid,itemid,100) then
doTeleportThing(cid, tpto)
doSendMagicEffect(tpto,10)
else
doPlayerSendTextMessage(cid,22, "Sorry, but it require 100 coins to enter here")
doSendMagicEffect(getThingPos(cid),10)
doTeleportThing(cid, fromPosition)
end
return true
end
function onStepIn(cid, item, fromPosition, itemEx, toPosition)
local newPosition = {x=1000, y=1000, z=7}
local item = 2548
if doPlayerRemoveItem(cid, item, 100) and isPlayer(cid) then
getThingfromPos(fromPosition)
doSendMagicEffect(fromPosition, CONST_ME_FIREAREA)
doTeleportThing(cid, newPosition)
doSendMagicEffect(newPosition, 10)
else
doPlayerSendCancel(cid, "you need 100 Script Coins")
end
return TRUE
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local tpos,v = {x=1000, y=1000, z=7},getThingPos(cid)
local item = 2547
if doPlayerRemoveItem(cid, item, 100) and isPlayer(cid) then
doTeleportThing(cid,tpos)
doSendMagicEffect(v,10)
else
doTeleportThing(cid,fromPosition)
doPlayerSendTextMessage(cid,19,'You need 100 Script Coins.')
doSendMagicEffect(v,2)
end
return true
end
I couldn't see anything wrong in this script, so I tested on 0.3.6 and and it worked fine for me.Here you go:
LUA:local tpto = {x = 100, y = 100, z = 7} local itemid = 2148 function onStepIn(cid, item, position, fromPosition) if not(isPlayer(cid)) then return true end if doPlayerRemoveItem(cid,itemid,100) then doTeleportThing(cid, tpto) doSendMagicEffect(tpto,10) else doPlayerSendTextMessage(cid,22, "Sorry, but it require 100 coins to enter here") doSendMagicEffect(getThingPos(cid),10) doTeleportThing(cid, fromPosition) end return true end