Mensajes : 67 Puntos : 192 Reputación : 22 Fecha de inscripción : 03/05/2011
Tema: [Action/Talkaction] Contrareloj! xD Jue Mayo 12, 2011 5:35 pm
funcion: se trata de qe estas en una habitacion y al darle a la palanca pues te lleva ala habitacion y comienzan aparacer piedras cada segundo, y debes encontrar la respuesta al problema que te pongan, si no lo haces pierdes, si lo haces ganas y te llevas 100cc, creo que lo mas complicado de adaptar es la posiciones de las piedras xD donde veis tods esas posiciones w1, w2, son las piedras i las posiciones en q apareceran y la funcion addingStones() pues ya se entiende xD .
Bueno pues este script lo hize en uno de los retos que ize con ranux pero nunca se llego a declarar como reto i pues lo publico, vais a actions/scripts/ creais un archivo y pegais esto:
Código:
function addingStones() addEvent(doCreateItem, 1000, stoneid, 1, w1) addEvent(doCreateItem, 2000, stoneid, 1, w10) addEvent(doCreateItem, 3000, stoneid, 1, w2) addEvent(doCreateItem, 4000, stoneid, 1, w11) addEvent(doCreateItem, 5000, stoneid, 1, w3) addEvent(doCreateItem, 6000, stoneid, 1, w12) addEvent(doCreateItem, 7000, stoneid, 1, w4) addEvent(doCreateItem, 8000, stoneid, 1, w13) addEvent(doCreateItem, 9000, stoneid, 1, w5) addEvent(doCreateItem, 10000, stoneid, 1, w14) addEvent(doCreateItem, 11000, stoneid, 1, w6) addEvent(doCreateItem, 12000, stoneid, 1, w15) addEvent(doCreateItem, 13000, stoneid, 1, w7) addEvent(doCreateItem, 14000, stoneid, 1, w16) addEvent(doCreateItem, 15000, stoneid, 1, w8) addEvent(doCreateItem, 16000, stoneid, 1, w17) addEvent(doCreateItem, 17000, stoneid, 1, w9) addEvent(doCreateItem, 18000, stoneid, 1, w18) addEvent(doCreateItem, 19000, stoneid, 1, w19) addEvent(doCreateItem, 20000, stoneid, 1, w24) addEvent(doCreateItem, 21000, stoneid, 1, w20) addEvent(doCreateItem, 22000, stoneid, 1, w25) addEvent(doCreateItem, 23000, stoneid, 1, w21) addEvent(doCreateItem, 24000, stoneid, 1, w26) addEvent(doCreateItem, 25000, stoneid, 1, w22) addEvent(doCreateItem, 26000, stoneid, 1, w27) addEvent(doCreateItem, 27000, stoneid, 1, w23) addEvent(doCreateItem, 28000, stoneid, 1, w28) addEvent(doCreateItem, 29000, stoneid, 1, w29) addEvent(doCreateItem, 30000, stoneid, 1, w34) addEvent(doCreateItem, 31000, stoneid, 1, w30) addEvent(doCreateItem, 32000, stoneid, 1, w35) addEvent(doCreateItem, 33000, stoneid, 1, w31) addEvent(doCreateItem, 34000, stoneid, 1, w36) addEvent(doCreateItem, 35000, stoneid, 1, w32) addEvent(doCreateItem, 36000, stoneid, 1, w37) addEvent(doCreateItem, 37000, stoneid, 1, w33) addEvent(doCreateItem, 38000, stoneid, 1, w38) addEvent(doCreateItem, 40000, stoneid, 1, w39) addEvent(doCreateItem, 41000, stoneid, 1, w41) addEvent(doCreateItem, 42000, stoneid, 1, w44) addEvent(doCreateItem, 43000, stoneid, 1, w42) addEvent(doCreateItem, 44000, stoneid, 1, w45) addEvent(doCreateItem, 45000, stoneid, 1, w43) addEvent(doCreateItem, 46000, stoneid, 1, w46) addEvent(doCreateItem, 47000, stoneid, 1, w47) addEvent(doCreateItem, 48000, stoneid, 1, w52) addEvent(doCreateItem, 49000, stoneid, 1, w48) addEvent(doCreateItem, 50000, stoneid, 1, w53) addEvent(doCreateItem, 51000, stoneid, 1, w49) addEvent(doCreateItem, 52000, stoneid, 1, w54) addEvent(doCreateItem, 53000, stoneid, 1, w50) addEvent(doCreateItem, 54000, stoneid, 1, w55) addEvent(doCreateItem, 55000, stoneid, 1, w51) addEvent(doCreateItem, 56000, stoneid, 1, w56) addEvent(doCreateItem, 57000, stoneid, 1, w57) addEvent(doCreateItem, 58000, stoneid, 1, w59) addEvent(doCreateItem, 59000, stoneid, 1, w58) addEvent(doCreateItem, 60000, stoneid, 1, w60) addEvent(doCreateItem, 61000, stoneid, 1, w62) addEvent(doCreateItem, 62000, stoneid, 1, w61) addEvent(doCreateItem, 63000, stoneid, 1, w63) addEvent(doCreateItem, 64000, stoneid, 1, w40) addEvent(doCreateItem, 65000, stoneid, 1, stoneloser) end function checkRdone2(cid) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, 3456) == 1 and getPlayerPosition(cid).x == stoneloser.x and getPlayerPosition(cid).y == stoneloser.y then addEvent(doPlayerAddItem, 1000, cid, 2160, 100) doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Ganaste y recibiste 100cc por tu savia respuesta!") addEvent(doItemSetAttribute, 1000, switch.uid, "aid", 4444) addEvent(doCreateItem, 1000, switchid, 1, switchpos) doCreatureSetNoMove(cid, false) doTeleportThing(cid, {x = 75, y = 108, z = 7}) stopEvent(checkRdone) stopEvent(addingStones) addEvent(clean, 1000) addEvent(clean, 2000) addEvent(clean, 3000) elseif getPlayerStorageValue(cid, 3456) ~= 1 and getPlayerPosition(cid).x == stoneloser.x and getPlayerPosition(cid).y == stoneloser.y then return true else end end function checkRdone(cid) if not isPlayer(cid) then return true end if getPlayerStorageValue(cid, 3456) == 1 and getPlayerPosition(cid).x == stoneloser.x and getPlayerPosition(cid).y == stoneloser.y then addEvent(doPlayerAddItem, 1000, cid, 2160, 100) doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Ganaste y recibiste 100cc por tu savia respuesta!") addEvent(doItemSetAttribute, 1000, switch.uid, "aid", 4444) addEvent(doCreateItem, 1000, switchid, 1, switchpos) doCreatureSetNoMove(cid, false) doTeleportThing(cid, {x = 75, y = 108, z = 7}) stopEvent(addingStones) addEvent(clean, 1000) addEvent(clean, 2000) addEvent(clean, 3000) return true elseif getPlayerStorageValue(cid, 3456) ~= 1 and getPlayerPosition(cid).x == stoneloser.x and getPlayerPosition(cid).y == stoneloser.y then doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Perdiste! Otra vez sera!") addEvent(doItemSetAttribute, 1000, switch.uid, "aid", 4444) addEvent(doSendMagicEffect, 1000, cid, CONST_ME_TELEPORT) doTeleportThing(cid, {x = 75, y = 108, z = 7}) doCreatureSetNoMove(cid, false) addEvent(clean, 1000) addEvent(clean, 2000) addEvent(clean, 3000) addEvent(doCreateItem, 1000, switchid, switchpos) return true end end function clean() for posx = 64,72 do for posy = 102,108 do posit = {x = posx, y = posy, z = 7, stackpos = 1} if (getThingFromPos(posit).itemid == 1353) then doRemoveItem(getThingFromPos(posit).uid) end end end end function onUse(cid, item, fromPosition, itemEx, toPosition) -------POSICIONES PIEDRAS w1 = {x = 64, y = 102, z = 7, stackpos = 1} w2 = {x = w1.x+1, y = 102, z = 7, stackpos = 1} w3 = {x = w1.x+2, y = 102, z = 7, stackpos = 1} w4 = {x = w1.x+3, y = 102, z = 7, stackpos = 1} w5 = {x = w1.x+4, y = 102, z = 7, stackpos = 1} w6 = {x = w1.x+5, y = 102, z = 7, stackpos = 1} w7 = {x = w1.x+6, y = 102, z = 7, stackpos = 1} w8 = {x = w1.x+7, y = 102, z = 7, stackpos = 1} w9 = {x = w1.x+8, y = 102, z = 7, stackpos = 1} w10 = {x = 64, y = 108, z = 7, stackpos = 1} w11 = {x = w1.x+1, y = 108, z = 7, stackpos = 1} w12 = {x = w1.x+2, y = 108, z = 7, stackpos = 1} w13 = {x = w1.x+3, y = 108, z = 7, stackpos = 1} w14 = {x = w1.x+4, y = 108, z = 7, stackpos = 1} w15 = {x = w1.x+5, y = 108, z = 7, stackpos = 1} w16 = {x = w1.x+6, y = 108, z = 7, stackpos = 1} w17 = {x = w1.x+7, y = 108, z = 7, stackpos = 1} w18 = {x = w1.x+8, y = 108, z = 7, stackpos = 1} w19 = {x = 64, y = 103, z = 7, stackpos = 1} w20 = {x = 64, y = w19.y+1, z = 7, stackpos = 1} w21 = {x = 64, y = w19.y+2, z = 7, stackpos = 1} w22 = {x = 64, y = w19.y+3, z = 7, stackpos = 1} w23 = {x = 64, y = w19.y+4, z = 7, stackpos = 1} w24 = {x = 72, y = 103, z = 7, stackpos = 1} w25 = {x = 72, y = w19.y+1, z = 7, stackpos = 1} w26 = {x = 72, y = w19.y+2, z = 7, stackpos = 1} w27 = {x = 72, y = w19.y+3, z = 7, stackpos = 1} w28 = {x = 72, y = w19.y+4, z = 7, stackpos = 1} w29 = {x = 65, y = 103, z = 7, stackpos = 1} w30 = {x = w29.x+1, y = 103, z = 7, stackpos = 1} w31 = {x = w29.x+2, y = 103, z = 7, stackpos = 1} w32 = {x = w29.x+3, y = 103, z = 7, stackpos = 1} w33 = {x = w29.x+4, y = 103, z = 7, stackpos = 1} w34 = {x = w29.x+5, y = 103, z = 7, stackpos = 1} w35 = {x = w29.x+6, y = 103, z = 7, stackpos = 1} w36 = {x = 65, y = 107, z = 7, stackpos = 1} w37 = {x = w36.x+1, y = 107, z = 7, stackpos = 1} w38 = {x = w36.x+2, y = 107, z = 7, stackpos = 1} w40 = {x = w36.x+3, y = 107, z = 7, stackpos = 1} w41 = {x = w36.x+4, y = 107, z = 7, stackpos = 1} w42 = {x = w36.x+5, y = 107, z = 7, stackpos = 1} w43 = {x = w36.x+6, y = 107, z = 7, stackpos = 1} w44 = {x = 65, y = 104, z = 7, stackpos = 1} w45 = {x = 65, y = w44.y+1, z = 7, stackpos = 1} w46 = {x = 65, y = w44.y+2, z = 7, stackpos = 1} w47 = {x = 71, y = 104, z = 7, stackpos = 1} w48 = {x = 71, y = w44.y+1, z = 7, stackpos = 1} w49 = {x = 71, y = w44.y+2, z = 7, stackpos = 1} w50 = {x = 66, y = 104, z = 7, stackpos = 1} w51 = {x = w50.x+1, y = 104, z = 7, stackpos = 1} w52 = {x = w50.x+2, y = 104, z = 7, stackpos = 1} w53 = {x = w50.x+3, y = 104, z = 7, stackpos = 1} w54 = {x = w50.x+4, y = 104, z = 7, stackpos = 1} w55 = {x = 66, y = 106, z = 7, stackpos = 1} w56 = {x = w50.x+1, y = 106, z = 7, stackpos = 1} w57 = {x = w50.x+2, y = 106, z = 7, stackpos = 1} w58 = {x = w50.x+3, y = 106, z = 7, stackpos = 1} w59 = {x = w50.x+4, y = 106, z = 7, stackpos = 1} w60 = {x = 66, y = 105, z = 7, stackpos = 1} w61 = {x = w50.x+4, y = 105, z = 7, stackpos = 1} w62 = {x = 67, y = 105, z = 7, stackpos = 1} w63 = {x = 69, y = 105, z = 7, stackpos = 1} -------------- stoneloser = {x = 68, y = 105, z = 7, stackpos = 1} switchpos = {x = 74, y = 106, z = 7, stackpos = 1} switchid = 1945 stoneid = 1353 switch = getThingFromPos(switchpos) if item.actionid == 4444 and item.itemid == switchid then doRemoveItem(switch.uid, 1) doCreatureSetNoMove(cid, true) doTeleportThing(cid, stoneloser) addEvent(addingStones, 1000)---- doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Di /re!") end if isPlayer(cid) then addEvent(checkRdone2, 30000, cid) addEvent(checkRdone, 66000, cid) end end
Ahora vais a talkactions/scripts y creais un archivo lua i pones esto
Código:
function onSay(cid, words, param, channel) msg = "Cuanto es 25 + 20 * 6 + 10 / 2?" stone = {x = 68, y = 105, z = 7, stackpos = 1} if param == '140' and getPlayerPosition(cid).x == stone.x and getPlayerPosition(cid).y == stone.y then doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Respuesta correcta!, Espera a que las piedras se completen!") doPlayerSetStorageValue(cid, 3456, 1) msg = "" return 0 elseif param == '' then elseif param ~= '140' then doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Respuesta incorrecta!") doCreatureAddHealth(cid, -200) end if getPlayerPosition(cid).x ~= stone.x and getPlayerPosition(cid).y ~= stone.y then msg = "" end doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, msg) return 0 end