piradeco 11 Posted July 5, 2021 Share Posted July 5, 2021 (edited) Gostaria de modificar esse script para o tfs.12 Edited July 12, 2021 by piradeco Link to comment Share on other sites More sharing options...
0 Yan Oliveira 214 Posted July 13, 2021 Share Posted July 13, 2021 Substitua o código por este: local message_color = 25 -- COR DA MENSAGEM function getSpectators(fromPos, toPos) -- Function made by Vodkart local players = {} for _, pid in ipairs(getSpectators()) do if isInRange(getSpectators(pid), fromPos, toPos) then table.insert(players, pid) end end return players end -- Do not remove the credits ---- [MOVEEVENT] Limite de player por sala ---- Developed by Rigby ---- Especially for the Xtibia.com -- function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) local config = { [2233] = {area = getPlayersInArea({x = 696, y = 971, z = 11}, {x = 821, y = 1063, z = 12}), amountOfPlayers = 4, teleport = Position(721, 1003, 11)}, [2234] = {area = getPlayersInArea({x = 725, y = 1069, z = 11}, {x = 895, y = 1126, z = 12}), amountOfPlayers = 4, teleport = Position(685, 991, 11)}, [2235] = {area = getPlayersInArea({x = 448, y = 192, z = 11}, {x = 523, y = 230, z = 12}), amountOfPlayers = 4, teleport = Position(464, 202, 11)}, } if config[item.actionid] then if #config[item.actionid].area < config[item.actionid].amountOfPlayers then cid:teleportTo(config[item.actionid].teleport) cid:sendTextMessage(message_color, "Welcome") else cid:sendTextMessage(message_color, "The room already reached its limit " .. config[item.actionid].amountOfPlayers .. " player 's wait someone out.") cid:teleportTo(fromPosition) end end return true end Também criei uma variável para armazenar a cor do texto para ficar mais fácil caso queira mudar. Teste e me informe se der algum problema. Link to comment Share on other sites More sharing options...
0 Yan Oliveira 214 Posted July 10, 2021 Share Posted July 10, 2021 Para te ajudarmos, poste o código de forma organizada e dentro de CODES ou Spoiler para ficar mais fácil de visualizar e te ajudar, pois desse jeito está difícil visualizar. Link to comment Share on other sites More sharing options...
0 piradeco 11 Posted July 12, 2021 Author Share Posted July 12, 2021 (edited) Em 10/07/2021 em 02:28, Yan Oliveira disse: Para te ajudarmos, poste o código de forma organizada e dentro de CODES ou Spoiler para ficar mais fácil de visualizar e te ajudar, pois desse jeito está difícil visualizar. Tópico editado para melhor entendimento Edited July 12, 2021 by piradeco Link to comment Share on other sites More sharing options...
0 piradeco 11 Posted July 14, 2021 Author Share Posted July 14, 2021 (edited) Em 12/07/2021 em 22:18, Yan Oliveira disse: Substitua o código por este: local message_color = 25 -- COR DA MENSAGEM function getSpectators(fromPos, toPos) -- Function made by Vodkart local players = {} for _, pid in ipairs(getSpectators()) do if isInRange(getSpectators(pid), fromPos, toPos) then table.insert(players, pid) end end return players end -- Do not remove the credits ---- [MOVEEVENT] Limite de player por sala ---- Developed by Rigby ---- Especially for the Xtibia.com -- function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) local config = { [2233] = {area = getPlayersInArea({x = 696, y = 971, z = 11}, {x = 821, y = 1063, z = 12}), amountOfPlayers = 4, teleport = Position(721, 1003, 11)}, [2234] = {area = getPlayersInArea({x = 725, y = 1069, z = 11}, {x = 895, y = 1126, z = 12}), amountOfPlayers = 4, teleport = Position(685, 991, 11)}, [2235] = {area = getPlayersInArea({x = 448, y = 192, z = 11}, {x = 523, y = 230, z = 12}), amountOfPlayers = 4, teleport = Position(464, 202, 11)}, } if config[item.actionid] then if #config[item.actionid].area < config[item.actionid].amountOfPlayers then cid:teleportTo(config[item.actionid].teleport) cid:sendTextMessage(message_color, "Welcome") else cid:sendTextMessage(message_color, "The room already reached its limit " .. config[item.actionid].amountOfPlayers .. " player 's wait someone out.") cid:teleportTo(fromPosition) end end return true end Também criei uma variável para armazenar a cor do texto para ficar mais fácil caso queira mudar. Teste e me informe se der algum problema. Nao aconteceu nd porem nao deu erro nem um -----EEDIT------ ERRO MEU troquei a tag no xml pegou certinho aqui obg ^^ Edited July 14, 2021 by piradeco Link to comment Share on other sites More sharing options...
0 Yan Oliveira 214 Posted July 14, 2021 Share Posted July 14, 2021 (edited) 7 horas atrás, piradeco disse: Nao aconteceu nd porem nao deu erro nem um -----EEDIT------ ERRO MEU troquei a tag no xml pegou certinho aqui obg ^^ Que bom que deu certo! A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico. Tópico movido de Suporte > OTServ > Scripts para Suporte > OTServ > Resolvidos. Edited July 14, 2021 by Yan Oliveira Link to comment Share on other sites More sharing options...
Question
piradeco 11
Gostaria de modificar esse script para o tfs.12
Edited by piradecoLink to comment
Share on other sites
5 answers to this question
Recommended Posts