FAQFAQ   SzukajSzukaj   UżytkownicyUżytkownicy   GrupyGrupy   GalerieGalerie www.generationforum.fora.pl 
 ProfilProfil   Zaloguj się, by sprawdzić wiadomościZaloguj się, by sprawdzić wiadomości   ZalogujZaloguj 
 
zamykajacy sie most

 
Napisz nowy temat   Odpowiedz do tematu    Forum www.generationforum.fora.pl Strona Główna -> OTS

Faden
Moderator



Dołączył: 01 Paź 2008
Posty: 41
Przeczytał: 0 tematów

Pomógł: 1 raz
Ostrzeżeń: 0/5
Skąd: Lublin

PostWysłany: Nie 15:42, 19 Paź 2008    Temat postu: zamykajacy sie most
 
nie moj scrypt ale jest fajny

-- Drawbridge script for zackery on request - by Alreth (v1.01) (beginning) --
function onUse(cid, item, frompos, item2, topos)


lever = 2711 -- Enter the itemid of your lever
actid = 351 -- Enter the action id of the lever that controls the bridge
bridgeid = 472 -- Enter the itemid of the bridge
nobridgeid = 731 -- Enter the itemid of the water
object = 1580 -- Enter the object id of the bridge (when up)
topobject = 1582 -- Enter the object id of the top of the bridge (when up)
teleportto = {x = 97, y=85, z=7} -- Position players on bridge are teleported to

if (item.itemid == lever and item.actionid == actid) then
-- Bridge is down now, take it up
bridgeid = nobridgeid
bridgepos = {x=97, y=79, z=7, stackpos=0}
while (bridgepos.x <= 100) do
while (bridgepos.y <= 84) do
bridgepos.stackpos = 0
bridgething = getThingfromPos(bridgepos)
doTransformItem(bridgething.uid, bridgeid)

bridgepos.stackpos = 255
checkthing = getThingfromPos(bridgepos)
falloff = 0
while (checkthing.itemid == 1 or blah == 10) do
teleportto.x = getPlayerPosition(checkthing.uid).x
doTeleportThing(checkthing.uid, teleportto)
checkthing = getThingfromPos(bridgepos)
falloff = falloff + 1
end
bridgepos.y = bridgepos.y+1
end
bridgepos.x = bridgepos.x+1
bridgepos.y = 79
end

if (falloff == 1) then
ppl = "person"
else
ppl = "people"
end
doPlayerSendTextMessage(cid, 20, falloff.." "..ppl.." fell off the drawbridge.")

wallbridge = {x=97, y=84, z=7, stackpos=1}
while (wallbridge.z >= 5) do
while (wallbridge.x <= 100) do
wallthing = getThingfromPos(wallbridge)
if (wallthing.itemid ~= object) then
doCreateItem(object, 1, wallbridge)
end
wallbridge.x = wallbridge.x+1
end
wallbridge.z = wallbridge.z-1
wallbridge.x = 97
end
while (wallbridge.x <= 100) do
wallthing = getThingfromPos(wallbridge)
if (wallthing.itemid ~= topobject) then
doCreateItem(topobject, 1, wallbridge)
end
wallbridge.x = wallbridge.x+1
end
doTransformItem(item.uid, item.itemid+1)

elseif (item.itemid == lever+1 and item.actionid == actid) then
-- Bridge is up now, bring it down
bridgeid = bridgeid
bridgepos = {x=97, y=79, z=7, stackpos=0}
while (bridgepos.x <= 100) do
while (bridgepos.y <= 84) do
bridgepos.stackpos = 0
bridgething = getThingfromPos(bridgepos)
doTransformItem(bridgething.uid, bridgeid)
bridgepos.y = bridgepos.y+1
end
bridgepos.x = bridgepos.x+1
bridgepos.y = 79
end

wallbridge = {x=97, y=84, z=7, stackpos=1}
while (wallbridge.z >= 4) do
while (wallbridge.x <= 100) do
wallthing = getThingfromPos(wallbridge)
if (wallthing.itemid == object or wallthing.itemid == topobject) then
doRemoveItem(wallthing.uid, wallthing.type)
end
wallbridge.x = wallbridge.x+1
end
wallbridge.z = wallbridge.z-1
wallbridge.x = 97
end
doTransformItem(item.uid, item.itemid-1)

-- bugfix (drawbridge looks like still being up)--
playerpos = getPlayerPosition(cid)
playerpos.x = playerpos.x+1
doTeleportThing(cid, playerpos)
playerpos.x = playerpos.x-1
doTeleportThing(cid, playerpos)
-- bugfix end --
end
return 1

-- Drawbridge script (end) --
end



<action itemid="2711" script="lever.lua" />
<action itemid="2712" script="lever.lua" />



screen:
[link widoczny dla zalogowanych]
Polecam do robienia Domków w stylu zamku :]


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Napisz nowy temat   Odpowiedz do tematu    Forum www.generationforum.fora.pl Strona Główna -> OTS
Strona 1 z 1

Wyświetl posty z ostatnich:   
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach

 
Skocz do:  


fora.pl - załóż własne forum dyskusyjne za darmo
Skin Created by: Sigma12
Powered by phpBB © 2001, 2002 phpBB Group
Regulamin