Postado Março 18, 2015 10 anos Preciso de um script para TFS 1.0 para quando o player matar outro ele ganhar 10k Tenho esse script, funciona no 8.6 alguem pode me ajudar a adaptar? local reward = { item = 2152, count = 10 } function onKill(cid, target, lastHit) if isPlayer(cid) and isPlayer(target) and lastHit then doPlayerAddItem(cid, reward.item, reward.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Mataste un player asi que ganas " .. reward.count .. " platinium!.") end return true end
Postado Março 18, 2015 10 anos Tenta assim: local reward = { item = 2152, count = 10 } function onKill(cid, target, lastHit) local target = Creature(target) if target:isPlayer() and lastHit then doPlayerAddItem(cid, reward.item, reward.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Mataste un player asi que ganas " .. reward.count .. " platinium!.") end return true end Atenciosamente, Bruno Minervino
Postado Março 18, 2015 10 anos local reward = { item = 2152, count = 10 } function onDeath(cid, corpse, lasthit) local player = Player(lasthit) if isPlayer(cid) and player:isPlayer() then player:addItem(reward.item, reward.count) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Mataste un player asi que ganas " .. reward.count .. " platinium!.") end return true end <event type="death" name="EVENTNAME" script="ARQUIVO.lua"/> Lembre-se de registrar no login.lua ... @Bruno Minervino não tenho certeza mas acredito que no tfs 1.0 não tem lasthit na callback onKill. Editado Março 18, 2015 10 anos por Summ (veja o histórico de edições)
Postado Março 18, 2015 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680Este tópico foi movido: De: "OTServ → Scripting → Geral" Para: "OTServ → Suporte OTServ → Suporte de Scripts" local reward = { item_id = 2152, item_count = 10 } function onKill(cid, target) local player = Player(cid) if target:isPlayer() then player:addItem(reward.item_id, reward.item_count) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Mataste un player asi que ganas " .. reward.item_count .. " platinium!.") end return true end STYLLER OT 2022
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.