Ot?? korzyustam z takiego skrypta:
Nie chce on dzialac. Gdy 4 graczy stoi na wyznaczonych polach i gdy jeden uzywa dzwigni to pisze ze potrzeba 4 ludzi do tego questu i nikogo nie przenosi. Prosze powiedziec co mam zle zrobione ;]
Oczywiscie dam reputa.
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- Annihaltor by Maxi (Shawak) v1.0
local room = { -- room with demons
fromX = 2118,
fromY = 2073,
fromZ = 10,
toX = 2124,
toY = 2077,
toZ = 10
}
local monster_pos = {
[1] = {pos = {2119,2073,10}},
[2] = {pos = {2123,2073,10}},
[3] = {pos = {2123,2075,10}},
[4] = {pos = {2124,2075,10}},
[5] = {pos = {2119,2077,10}},
[6] = {pos = {2123,2077,10}}
}
local players_pos = {
{x = 1224,y = 969,z = 11,stackpos = 253},
{x = 1223,y = 969,z = 7,stackpos = 253},
{x = 1222,y = 969,z = 7,stackpos = 253},
{x = 1221,y = 969,z = 7,stackpos = 253}
}
local new_player_pos = {
{x = 2122, y = 2075, z = 10},
{x = 2121, y = 2075, z = 10},
{x = 2120, y = 2075, z = 10},
{x = 2119, y = 2075, z = 10}
}
local monster = "Demon"
local questLevel = 100
-- don't touch ------------
local player = {0, 0, 0, 0}
local all_ready = 0
---------------------------
local player1 = getThingfromPos(players_pos[1])
local player2 = getThingfromPos(players_pos[2])
local player3 = getThingfromPos(players_pos[3])
local player4 = getThingfromPos(players_pos[4])
if item.itemid == 1945 then
if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
for i = 1, 4 do
player = getThingfromPos(players_pos)
if player.itemid > 0 then
all_ready = 1
end
end
else
doPlayerSendTextMessage(cid,19,"You need 4 players to do this quest.")
end
if all_ready == 1 then
for _, area in pairs(monster_pos) do
doSummonCreature(monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
end
for i = 1, 4 do
doSendMagicEffect(players_pos, CONST_ME_POFF)
doTeleportThing(player.uid, new_player_pos, FALSE)
doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
all_ready = 0
end
doTransformItem(item.uid,1946)
end
elseif item.itemid == 1946 then
local player_room = 0
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
if isPlayer(thing.uid) == TRUE then
player_room = player_room+1
end
end
end
end
end
if player_room >= 1 then
doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")
elseif player_room == 0 then
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
doRemoveCreature(thing.uid)
end
end
end
end
player_room = 0
doTransformItem(item.uid,1945)
end
end
return TRUE
end
Nie chce on dzialac. Gdy 4 graczy stoi na wyznaczonych polach i gdy jeden uzywa dzwigni to pisze ze potrzeba 4 ludzi do tego questu i nikogo nie przenosi. Prosze powiedziec co mam zle zrobione ;]
Oczywiscie dam reputa.