local config = {
[8001] = {pos = {x = 94, y = 112, z = 7}, level = 400}, -- position it should teleport the player to
[8002] = {pos = {x = 94, y = 113, z = 7}, level = 400},
[8003] = {pos = {x = 94, y = 114, z = 7}, level = 500}
}
function onStepIn(cid, item, position, fromPosition)
local x = config[item.uid]
if not x then
return false
end
if getPlayerLevel(cid) >= x.level then
doTeleportThing(cid, x.pos)
doSendMagicEffect(x.pos, CONST_ME_TELEPORT)
else
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, "You need to be at least level "..x.level.." to enter.")
end
return true
end
what file do i add this tooYou can add a movement stepin script.
Then add the uniqueids to the teleports/objects/items and in movements.xml.Code:local config = { [8001] = {pos = {x = 94, y = 112, z = 7}, level = 400}, -- position it should teleport the player to [8002] = {pos = {x = 94, y = 113, z = 7}, level = 400}, [8003] = {pos = {x = 94, y = 114, z = 7}, level = 500} } function onStepIn(cid, item, position, fromPosition) local x = config[item.uid] if not x then return false end if getPlayerLevel(cid) >= x.level then doTeleportThing(cid, x.pos) doSendMagicEffect(x.pos, CONST_ME_TELEPORT) else doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, "You need to be at least level "..x.level.." to enter.") end return true end
like if the object is on the portal it will still tp the char in but if its not on the object it worksCreate a new Lua file in movements for this script.
For other kind of support you can ask it here too.
function onPrepareDeath(cid, deathList)
local n = 0
for x = 1, 5 do
if getPlayerBlessing(cid, x) then
n = n + 1
end
end
if n == 5 and getCreatureSkullType(cid) ~= SKULL_RED then
doCreatureSetDropLoot(cid, false)
else
doCreatureSetDropLoot(cid, true)
end
return true
end
print("script load test")
Code:-- ### END OF CONFIG ### SQL_COMUNICATION_INTERVAL = SQL_interval * 1000 function onLogin(cid) if(InitShopComunication == 0) then local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {}) InitShopComunication = eventServ end
With who are you talking with? o_ohow come the body doesnt show up now?
what file do i add this too
<movevent type="StepIn" uniqueid="18135" event="script" value="levelteleport.lua"/>
local config = {
[18135] = {pos = {x = 94, y = 112, z = 7}, level = 400}, -- position it should teleport the player to
[18136] = {pos = {x = 94, y = 113, z = 7}, level = 400},
[18137] = {pos = {x = 94, y = 114, z = 7}, level = 500}
}
function onStepIn(cid, item, position, fromPosition)
local x = config[item.uid]
if not x then
return false
end
if getPlayerLevel(cid) >= x.level then
doTeleportThing(cid, x.pos)
doSendMagicEffect(x.pos, CONST_ME_TELEPORT)
else
doTeleportThing(cid, fromPosition)
doPlayerSendCancel(cid, "You need to be at least level "..x.level.." to enter.")
end
return true
end
function onPrepareDeath(cid, deathList)
local n = 0
for x = 1, 5 do
if getPlayerBlessing(cid, x) then
n = n + 1
end
end
if n == 5 and getCreatureSkullType(cid) ~= 4 then
doCreatureSetDropLoot(cid, false)
end
return true
end