KnightmareZ
New Member
hello there, I want a script like this:
-When 8 ppl on the SQM's and 8 ring of the skies on the 1 SQM above where the player should stand they can pull lever and ring of the skies disapears and they get TPed..
This is the code someone made for me so far but doesnt work..
action.lua:
I got the lever with UID: 7575
Here is a picture how it should look like:
Thank you! rep++
-When 8 ppl on the SQM's and 8 ring of the skies on the 1 SQM above where the player should stand they can pull lever and ring of the skies disapears and they get TPed..
This is the code someone made for me so far but doesnt work..
Code:
local playerPos =
{
{x = 33273, y = 31055, z = 8},
{x = 33274, y = 31055, z = 8},
{x = 33275, y = 31055, z = 8},
{x = 33276, y = 31055, z = 8},
{x = 33277, y = 31055, z = 8},
{x = 33278, y = 31055, z = 8},
{x = 33279, y = 31055, z = 8},
{x = 33280, y = 31055, z = 8}
}
local newPos =
{
{x = 33311, y = 31062, z = 9},
{x = 33313, y = 31062, z = 9},
{x = 33315, y = 31062, z = 9},
{x = 33312, y = 31064, z = 9},
{x = 33314, y = 31064, z = 9},
{x = 33311, y = 31066, z = 9},
{x = 33313, y = 31066, z = 9},
{x = 33315, y = 31066, z = 9}
}
local itemID = 2123 --rots
local leverUID = 7575
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (leverUID == item.uid) then
for _, pos in ipairs(playerPos) do
pos.stackpos = 253
if not isPlayer(getThingFromPos(pos).uid) then
doPlayerSendCancel(cid, "Sorry, not Possible.")
return true
end
pos.stackpos = 2 --Change if necesary
pos.y = pos.y - 1 --1 sqm above player pos
if getThingFromPos(pos).itemid ~= itemID then
doPlayerSendCancel(cid, "Sorry, not Possible.")
return true
end
end
for k, pos in ipairs(playerPos) do
pos.stackpos = 253
doTeleportThing(getThingFromPos(pos).uid, newPos[k], false)
pos.stackpos = 2 --Change if necesary
pos.y = pos.y - 1 --1 sqm above player pos
doRemoveItem(getThingFromPos(pos).uid)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
return true
end
action.lua:
Code:
<action uniqueid="7575" event="script" value="quests/Underworldquest.lua"/>
I got the lever with UID: 7575
Here is a picture how it should look like:
Thank you! rep++