Postado Outubro 1, 2018 6 anos Base: 0.4 Bom dia meu povo, como o titulo já diz, eu queria uma script que fizesse isso; clica na porta, é checado se o player tem a storage, é teleportado para um lugar x se tiver, uma msg aparece pra ele se não tiver a storage. Citar local config = { tepos = {x=0000, y=0000, z=0} } function onUse(cid, item, frompos, item2, topos) if doTeleportThing(cid, config.tepos) then doPlayerSendTextMessage(cid, 22, "") end return true end
Postado Outubro 1, 2018 6 anos @Zazeros Citar local storage = 2501 local newpos = {x = 1000, y = 1000, z = 7} function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, storage) == 1 then doTeleportThing(cid, newpos) else doPlayerSendTextMessage(cid, 27, "mensagem que o player vai receber") doSendMagicEffect(getCreaturePosition(cid), 2) end return true end
Postado Outubro 1, 2018 6 anos Autor @Jovim Cara, mesmo com a storage, o player não foi teleportado, sem erros no console. Apenas aparece a msg que da quando o player não tem a storage
Postado Outubro 1, 2018 6 anos Autor @Jovim Alterei sim. Os players estão ganhando através dessa quest, quando acabam de falar com o npc: Citar local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local quest = 11269 local reward = 70000 function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then npcHandler:say("", cid) talkState[talkUser] = 2 elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then npcHandler:say("", cid) setPlayerStorageValue(cid, quest, 2) talkState[talkUser] = 0 elseif msgcontains(msg, "aceitar") then local str = getPlayerStorageValue(cid, quest) if(str < 2) then npcHandler:say("", cid) talkState[talkUser] = 1 return true elseif(str == 2) then npcHandler:say(".", cid) elseif(str == 3) then npcHandler:say(" ", cid) doPlayerAddExp(cid, 2000000) doPlayerAddItem(cid,2152,30) setPlayerStorageValue(cid, quest, 4) elseif(str == 4) then npcHandler:say("Voce ja matou nosso alvo.", cid) end talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.