Advertisement
Sossia

[Minigame] Transformation

Sep 29th, 2018
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 29.59 KB | None | 0 0
  1. --[[
  2. About: Transformation is a game where players need to use the powers (Flip: Box, board) to complete the map.
  3. Created by: Sossia#6280
  4. Status: Finished
  5. Translations: BR,EN
  6. ]]--
  7. --Variables
  8. inRoom = 0 -- Players in the room
  9. livePlayer = 0 -- Live players
  10. Data = {} --  Player data storage
  11. Rounds = 0
  12. InRounds = false
  13. -----
  14. maps = {'<C><P H="800" L="1600" /><Z><S><S X="923" L="3000" Y="806" H="51" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="66" L="128" Y="806" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="382" L="128" Y="806" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="702" L="128" Y="806" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1015" L="128" Y="806" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="951" L="3000" Y="661" H="51" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="1361" L="128" Y="806" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="214" L="128" Y="661" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="538" L="128" Y="661" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="867" L="128" Y="661" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1200" L="128" Y="661" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1519" L="128" Y="661" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1363" L="10" Y="717" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1429" L="10" Y="749" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="824" L="10" Y="609" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="991" L="3000" Y="520" H="51" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="1" L="128" Y="520" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="366" L="128" Y="520" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="704" L="128" Y="520" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1040" L="128" Y="520" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1366" L="128" Y="520" H="52" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="21" L="10" Y="759" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="371" L="520" Y="366" H="41" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="1061" L="520" Y="366" H="41" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="630" L="10" Y="470" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="803" L="10" Y="470" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="711" L="10" Y="406" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /></S><D><T X="368" Y="343" /><F X="1065" Y="344" /><DS X="58" Y="757" /><DC X="108" Y="770" /></D><O /></Z></C>','<C><P /><Z><S><S X="239" L="42" Y="396" H="234" P="0,0,0.3,0.2,90,0,0,0" T="8" /><S X="832" L="200" Y="113" H="87" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="799" L="200" Y="396" H="87" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="22" L="200" Y="396" H="87" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="582" L="42" Y="396" H="234" P="0,0,0.3,0.2,90,0,0,0" T="8" /><S X="415" L="200" Y="396" H="87" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="-33" L="200" Y="113" H="87" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="66" L="42" Y="91" H="234" P="0,0,0.3,0.2,90,0,0,0" T="8" /><S X="734" L="42" Y="92" H="234" P="0,0,0.3,0.2,90,0,0,0" T="8" /><S X="607" L="21" Y="109" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="192" L="21" Y="109" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="329" L="21" Y="314" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="499" L="21" Y="314" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="500" L="21" Y="271" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="498" L="21" Y="214" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="498" L="21" Y="160" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="494" L="21" Y="73" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="329" L="21" Y="271" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="327" L="21" Y="214" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="328" L="21" Y="160" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="328" L="21" Y="73" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="418" L="255" Y="313" H="10" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="418" L="255" Y="270" H="10" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="412" L="255" Y="161" H="10" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="412" L="255" Y="214" H="10" P="0,0,0.3,0.2,0,0,0,0" T="8" /></S><D><T X="762" Y="354" /><T X="46" Y="352" /><F X="755" Y="65" /><F X="27" Y="66" /><DS X="455" Y="341" /><DC X="455" Y="345" /></D><O /></Z></C>','<C><P L="1200" /><Z><S><S X="869" L="555" Y="145" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="197" L="155" Y="421" H="85" P="0,0,0.3,0.2,20,0,0,0" T="6" /><S X="441" L="300" Y="394" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="101" L="200" Y="377" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="428" L="32" Y="394" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="741" L="120" Y="394" H="35" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="494" L="555" Y="245" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="520" L="30" Y="322" H="10" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="65" L="888" Y="142" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="753" L="32" Y="243" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="520" L="32" Y="245" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="600" L="10" Y="142" H="47" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="205" L="200" Y="245" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="1031" L="25" Y="407" H="32" P="0,0,0,1.2,0,0,0,0" T="2" /><S X="-9" L="345" Y="143" H="45" P="0,0,0.3,0.2,40,0,0,0" T="6" /><S X="503" L="200" Y="142" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="573" L="32" Y="394" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="219" L="32" Y="142" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="826" L="10" Y="142" H="47" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="923" L="200" Y="142" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="1176" L="155" Y="347" H="555" P="0,0,0,0.2,40,0,0,0" T="1" /></S><D><T X="781" Y="376" /><F X="948" Y="110" /><DS X="23" Y="335" /><DC X="24" Y="333" /></D><O /></Z></C>','<C><P L="1200" /><Z><S><S X="197" L="155" Y="421" H="85" P="0,0,0.3,0.2,20,0,0,0" T="6" /><S X="441" L="300" Y="394" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="98" L="200" Y="379" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="446" L="32" Y="396" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="741" L="120" Y="394" H="35" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="494" L="555" Y="245" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="445" L="30" Y="310" H="10" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="65" L="888" Y="142" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="753" L="32" Y="243" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="520" L="32" Y="245" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="606" L="10" Y="142" H="47" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="205" L="200" Y="245" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="512" L="200" Y="140" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="954" L="196" Y="80" H="344" P="0,0,,,,0,0,0" T="9" /><S X="219" L="32" Y="142" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="29" L="200" Y="100" H="51" P="0,0,0.3,0.2,90,0,0,0" T="6" N="" /><S X="955" L="200" Y="243" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="953" L="199" Y="-52" H="13" P="0,0,0,20,0,0,0,0" T="3" /></S><D><T X="781" Y="376" /><F X="544" Y="112" /><DS X="23" Y="335" /><DC X="24" Y="333" /></D><O /></Z></C>','<C><P /><Z><S><S X="197" L="155" Y="421" H="85" P="0,0,0.3,0.2,20,0,0,0" T="6" /><S X="441" L="300" Y="394" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="101" L="200" Y="377" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="428" L="32" Y="394" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="741" L="120" Y="394" H="35" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="494" L="555" Y="245" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="520" L="30" Y="322" H="10" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="65" L="888" Y="142" H="42" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="753" L="32" Y="243" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="520" L="32" Y="245" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="606" L="10" Y="142" H="47" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="205" L="200" Y="245" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="-9" L="345" Y="143" H="45" P="0,0,0.3,0.2,40,0,0,0" T="6" /><S X="503" L="200" Y="142" H="51" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="573" L="32" Y="394" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /><S X="219" L="32" Y="142" H="45" P="0,0,0.3,0.2,0,0,0,0" T="6" N="" /></S><D><T X="781" Y="376" /><F X="524" Y="109" /><DS X="23" Y="335" /><DC X="24" Y="333" /></D><O /></Z></C>','<C><P /><Z><S><S X="12" L="24" Y="79" H="444" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="27" L="54" Y="288" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="269" L="54" Y="275" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="450" L="54" Y="275" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="271" L="45" Y="275" H="184" P="0,0,0.3,0.2,40,0,0,0" T="8" /><S X="635" L="54" Y="223" H="26" P="0,0,0.3,0.2,-50,0,0,0" T="0" /><S X="466" L="45" Y="91" H="184" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="467" L="54" Y="169" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="500" L="10" Y="169" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="436" L="10" Y="169" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="309" L="54" Y="169" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="342" L="10" Y="169" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="276" L="10" Y="169" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="74" L="22" Y="70" H="255" P="0,0,0.3,0.2,-40,0,0,0" T="0" N="" /><S X="161" L="10" Y="158" H="10" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="261" L="54" Y="82" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="451" L="45" Y="275" H="184" P="0,0,0.3,0.2,40,0,0,0" T="8" /><S X="635" L="45" Y="223" H="184" P="0,0,0.3,0.2,40,0,0,0" T="8" /><S X="262" L="45" Y="80" H="184" P="0,0,0.3,0.2,40,0,0,0" T="8" /><S X="28" L="54" Y="136" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" /></S><D><T X="183" Y="55" /><F X="45" Y="128" /><DS X="38" Y="122" /><DC X="42" Y="134" /></D><O /></Z></C>','<C><P /><Z><S><S X="11" L="47" Y="229" H="72" P="0,0,0,1.2,40,0,0,0" T="2" /><S X="441" L="615" Y="371" H="52" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="12" L="24" Y="79" H="444" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="27" L="54" Y="288" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="161" L="54" Y="371" H="54" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="139" L="10" Y="112" H="35" P="0,0,20,0.2,40,0,0,0" T="4" /><S X="65" L="225" Y="177" H="10" P="0,0,0,0.2,130,0,0,0" T="1" /><S X="456" L="54" Y="260" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="362" L="15" Y="75" H="10" P="0,0,0.3,0.2,40,0,0,0" T="0" /><S X="147" L="10" Y="100" H="15" P="0,0,20,0.2,-50,0,0,0" T="4" /><S X="257" L="54" Y="260" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="581" L="444" Y="84" H="15" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="63" L="22" Y="190" H="255" P="0,0,0.3,0.2,-140,0,0,0" T="0" N="" /><S X="349" L="26" Y="80" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="361" L="54" Y="371" H="54" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="561" L="54" Y="371" H="54" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="721" L="54" Y="371" H="54" P="0,0,0.3,0.2,0,0,0,0" T="0" /><S X="643" L="54" Y="260" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="458" L="615" Y="221" H="52" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="354" L="54" Y="182" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="568" L="54" Y="182" H="26" P="0,0,0.3,0.2,0,0,0,0" T="0" N="" /><S X="816" L="79" Y="350" H="101" P="0,0,0,1.2,40,0,0,0" T="2" /><S X="802" L="54" Y="357" H="54" P="0,0,0.3,0.2,-50,0,0,0" T="0" /><S X="840" L="73" Y="303" H="66" P="0,0,0.3,0.2,0,0,0,0" T="0" /></S><D><T X="779" Y="75" /><F X="50" Y="38" /><DS X="34" Y="261" /><DC X="40" Y="258" /></D><O /></Z></C>','<C><P F="3" /><Z><S><S X="348" L="999" Y="439" H="124" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="401" L="10" Y="233" H="238" P="1,0,0.3,0.2,0,0,0,0" T="0" /><S X="400" L="10" Y="233" H="238" P="1,0,0.3,0.2,-90,0,0,0" T="0" /><S X="668" L="276" Y="233" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="136" L="276" Y="233" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="41" L="80" Y="226" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="759" L="80" Y="226" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /></S><D><T X="780" Y="208" /><F X="28" Y="201" /></D><O><O C="12" X="402" P="0" Y="236" /></O></Z></C>','<C><P F="3" /><Z><S><S X="348" L="999" Y="439" H="124" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="401" L="10" Y="233" H="238" P="1,0,0.3,0.2,0,0,0,0" T="0" /><S X="400" L="10" Y="233" H="238" P="1,0,0.3,0.2,-90,0,0,0" T="0" /><S X="668" L="276" Y="233" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="136" L="276" Y="233" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="271" L="10" Y="136" H="30" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="41" L="80" Y="226" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="759" L="80" Y="226" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="136" L="276" Y="147" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="234" L="80" Y="140" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="140" L="276" Y="67" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="40" L="80" Y="65" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /></S><D><T X="780" Y="208" /><F X="266" Y="44" /></D><O><O C="12" X="402" P="0" Y="236" /></O></Z></C>','<C><P F="3" /><Z><S><S X="348" L="999" Y="439" H="124" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="401" L="10" Y="233" H="238" P="1,0,0.3,0.2,0,0,0,0" T="0" /><S X="400" L="10" Y="233" H="238" P="1,0,0.3,0.2,-90,0,0,0" T="0" /><S X="668" L="276" Y="233" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="136" L="276" Y="233" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="41" L="80" Y="226" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="759" L="80" Y="226" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="403" L="10" Y="234" H="238" P="1,0,0.3,0.2,-40,0,0,0" T="0" /><S X="402" L="10" Y="235" H="238" P="1,0,0.3,0.2,-140,0,0,0" T="0" /><S X="142" L="276" Y="130" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="241" L="80" Y="129" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /><S X="675" L="276" Y="134" H="26" P="0,0,0.3,0.2,0,0,0,0" T="8" /><S X="572" L="80" Y="129" H="37" P="0,0,0.3,0.2,0,0,0,0" T="6" /></S><D><F X="39" Y="42" /><DS X="464" Y="355" /><T X="784" Y="75" /></D><O><O C="12" X="402" P="0" Y="236" /></O></Z></C>'}
  15. -----
  16. -- Shop and Help
  17. ui.addTextArea(1, "<p align='center'><a href='event:shop'><B><CE>Shop</a>", name, 675, 26, 54, 21, 0x324650, 0x324650, 1, true)
  18. ui.addTextArea(2, "<p align='center'><a href='event:help'><B><CE>Help</a>", name, 741, 26, 54, 21, 0x324650, 0x324650, 1, true)
  19.  
  20. --Disable some automatic things.
  21. for _, s in next, {'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'AutoShaman', 'AutoNewGame'} do
  22.     tfm.exec['disable' .. s]()
  23. end
  24.  
  25. -- Translations
  26. translations = {br = {Buy_SC = "<VP>A habilidade de segunda chance foi adquirida. Você tem 3 chances, mas você só pode usar uma chance por rodada.", Buy_JP = "<VP>Você comprou 3 saltos!!", Buy_ES = "<VP>Você comprou a habilidade de dobrar o seu tamanho. Clique na text area para dobrar seu tamanho.", Buy_VP = "<VP> Você será um vampiro, durante três partidas. Mas você não pode pegar o queijo :(", Usage_ES = "<VP>Você dobrou o seu tamanho, restam ", Coins = "<j>Moedas:</J><R>", Coins50 = "<b><R>50 Moedas", Coins75 = "<b><R>75 Moedas", Coins100 = "<b><R>100 Moedas", Coins200 = "<b><R>200 Moedas", Died = "<R>Opa! Você morreu!!", Won = "<VP>Eba! Você entrou na toca!", UnlockLevel = "<VP>Boa, você desbloqueou um novo nível", NoMoney = "<R>Você não tem moedas suficientes para comprar este item. Jogue mais algumas partidas e tente novamente.", Help = "<VP>Seja cooperativo com outros jogadores e use seu poder de transformação para chegar ao queijo. Ganhe pontos por vitórias, suba de nível, compre segundas chances e até mesmo SALTOS!", Jumps = "<VP>Pulos", JumpLimites = "<R>Você atingiu o limite de saltos nesta rodada.", VampireTimeOff = "<R>Você não é mais um vampiro!", soulmateOn = "<R>O modo alma-gêmea começou.", soulmateOff = "<R>O modo alma-gêmea acabou.", Shop = "<CH><B>Loja", Second_Chance = "Segunda Chance", Shop_VPInfor = "\n\n\n<J>Vampiro 3 rodadas", Shop_SCInfor = "\n\n<J>Segundas Chances 3x", Shop_JPInfor = "\n\n\n<J>Pulos 3x", Shop_ESInfor = "\n\n<J>Tamanho Extra 3x", }, en = {Buy_SC = "<VP>The second chance skill was acquired. You've 3 chances, but you can only use one chance per round.", Buy_JP = "<VP>You got 3 jumps", Buy_ES = "<VP>You've bought the ability to double your size. Click the text area to double its size.", Buy_VP = "<VP> You will be a vampire for three rounds. But you can not get the cheese :(", Usage_ES = "<VP>You doubled your size, there are ", Coins = "<j>Coins:</J><R>", Coins50 = "<b><R>50 Coins", Coins75 = "<B><R>75 Coins", Coins100 = "<b><R>100 Coins", Coins200 = "<b><R> 200 Coins", Died = "<R>Ops! You died!!", Won = "<VP>Gj, You won!", UnlockLevel = "<R>Good job, you've unlocked a new level", NoMoney = "<R>You don't have enough coins to buy this item. Play a few more matches and try again.", Help = "<VP>Be cooperative with other players and use their transformational power to get to the cheese. Earn points for victories, level up, buy second chances and even JUMPS!", Jumps = "<VP>Jumps", JumpLimites = "<R>You've reached the jumping limit in this round.", VampireTimeOff = "<R>You're not a vampire anymore!", soulmateOn = "<R>The soulmate mode started", soulmateOff = "<R>The soulmate mode has been finalized", Shop = "<CH><B>Shop", Second_Chance = "Second Chance", Shop_VPInfor = "\n\n\n<B><J>Vampire 3 rounds", Shop_SCInfor = "\n\n\n<B><J>Second Chances 3x", Shop_JPInfor = "\n\n\n<B><J>Jumps 3x", Shop_ESInfor = "\n\n\n<B><J>Extra Size 3x", }, }
  27.  
  28. -- New Player
  29. eventNewPlayer = function(name)
  30.     inRoom = inRoom + 1
  31.     Data[name] = {
  32.         Activated_Jump = false, --
  33.         Activated_CS = false, --  
  34.         Activated_Vampire = false, --
  35.         Buyed_CS = false, --
  36.         Buyed_VP = false, --
  37.         ChangesSize = 0, --
  38.         Coins = 0, -- Player Coins     
  39.         Language = "", -- Languagues
  40.         XP = 0, -- Player Experience
  41.         Level = 0, -- Player level
  42.         Second_Chance = 0, -- Allows the player to relive once again after dying. Note: Only works once per match.
  43.         Usage_SecondC = false, -- Informs whether the player has already used or not the second chance in the current round
  44.         Jump = 0, --
  45.         TimeVampire = 0, --
  46.     }
  47.     tfm.exec.respawnPlayer(name)
  48.     settingsKeyboard(name) -- Settings keyboard player
  49.     Data[name].Language = translations[tfm.get.room.playerList[name].community] and tfm.get.room.playerList[name].community or 'en'
  50. end
  51.  
  52. -- New Game
  53. eventNewGame = function()
  54.     livePlayer = 0
  55.     for name in pairs(tfm.get.room.playerList) do -- All players
  56.         livePlayer = livePlayer + 1 -- Adds one more to the variable
  57.         Rounds = Rounds + 1
  58.         tfm.exec.giveTransformations(name,true)
  59.         Data[name].Usage_SecondC = false -- The value returns false, to say that it has not been used yet.
  60.         Data[name].Jump = 0 -- The variable that stores the value of the amount of "jumps" returns to 0
  61.         Data[name].Activated_CS = false
  62.         tfm.exec.changePlayerSize(name,1)
  63.         removeTextAreaChangeSize(name)
  64.         Round()
  65.         if Data[name].Buyed_CS == true then
  66.             ui.addTextArea(14, "<font size='15'><b><p align='center'><CH><a href='event:doubleSize'>Double size</a></p>", name, 652, 355, 138, 31, 0x315250, 0xc74949, 0.5, true)
  67.         end  
  68.         if Data[name].Buyed_VP == true then
  69.             tfm.exec.setVampirePlayer(name)
  70.             Data[name].TimeVampire = Data[name].TimeVampire + 1
  71.         end
  72.         if Data[name].TimeVampire == 3 then
  73.             Data[name].Activated_Vampire = false
  74.             Data[name].TimeVampire = 0
  75.             Data[name].Buyed_VP = false
  76.             tfm.exec.chatMessage(""..translations[Data[name].Language].VampireTimeOff.."",name)
  77.         end    
  78.     end
  79. end
  80.  
  81. -- Round
  82. Round = function()
  83.     local aux = {}
  84.     for name in pairs(tfm.get.room.playerList) do
  85.         aux[#aux+1] = name
  86.     end
  87.     if Rounds >= 10 then
  88.         for i=1, #aux-1, 2 do
  89.             tfm.exec.linkMice(aux[i], aux[i+1], true)
  90.             for name in pairs(tfm.get.room.playerList) do
  91.                 tfm.exec.chatMessage(""..translations[Data[name].Language].soulmateOn.."",name)
  92.             end
  93.         end
  94.     end
  95.     if Rounds >= 20 then
  96.         for i=1, #aux-1, 2 do
  97.             tfm.exec.linkMice(aux[i], aux[i+1], false)
  98.             for name in pairs(tfm.get.room.playerList) do
  99.                 tfm.exec.chatMessage(""..translations[Data[name].Language].soulmateOff.."",name)
  100.             end
  101.         end            
  102.         Rounds = 0
  103.     end
  104. end
  105.  
  106. -- Event Loop
  107. eventLoop = function(current,remaining)
  108.     if livePlayer == 0 or remaining <= 0 then -- If the number of live players = 0 or time = 0
  109.         tfm.exec.newGame(maps[math.random(#maps)])
  110.     end
  111. end
  112.  
  113. -- When player die
  114. eventPlayerDied = function(name)
  115.     livePlayer = livePlayer - 1 -- The variable receives its own value - 1
  116.     tfm.exec.chatMessage(""..translations[Data[name].Language].Died.."",name)
  117.     tfm.exec.changePlayerSize(name,1)
  118.     if Data[name].Second_Chance > 0 and Data[name].Usage_SecondC == false then
  119.         ui.addTextArea(13, "<font size='20'><b><p align='center'><CH><a href='event:usage_sc'>"..translations[Data[name].Language].Second_Chance.."</a></p>", name, 298, 185, 203, 30, 0x315250, 0xc74949, 0.5, true)
  120.     end
  121. end
  122.  
  123. -- PLayer Won
  124. eventPlayerWon = function(name)
  125.     Data[name].XP = Data[name].XP + 5
  126.     Data[name].Coins = Data[name].Coins + 10
  127.     livePlayer = livePlayer - 1
  128.     tfm.exec.chatMessage(""..translations[Data[name].Language].Won.."",name)
  129.     unlockLevel(name)
  130.     if Data[name].Buyed_CS == true then
  131.         ui.addTextArea(14, "<font size='15'><b><p align='center'><CH><a href='event:doubleSize'>Double size</a></p>", name, 652, 355, 138, 31, 0x315250, 0xc74949, 0.5, true)
  132.     end
  133. end
  134.  
  135.  
  136. -- If the player leaves the room
  137. eventPlayerLeft = function(name)
  138.   livePlayer = livePlayer - 1
  139.   inRoom = inRoom - 1
  140. end
  141.  
  142. --Unlock level
  143. unlockLevel = function(name)
  144.     if Data[name].XP >= 100 then
  145.         Data[name].Level = Data[name].Level + 1
  146.         Data[name].XP = 0
  147.         tfm.exec.chatMessage(""..translations[Data[name].Language].UnlockLevel.."",name)
  148.     end
  149. end
  150.  
  151. --
  152. removeTextAreaChangeSize = function(name)
  153.     if Data[name].Activated_CS == true then
  154.         ui.removeTextArea(14,name)
  155.     elseif Data[name].ChangesSize < 1 then
  156.         Data[name].Buyed_CS = false
  157.     end
  158. end
  159.  
  160. -- Settings text areas
  161. eventTextAreaCallback = function(t,name,link)
  162.     if link == "shop" then
  163.         ui.addTextArea(50, "<p align='left'><font size='25'>"..translations[Data[name].Language].Shop.."</font></p>", name, 195, 87, 412, 234, 0x313a4a, 0x313a4a, 1, true)
  164.         ui.addTextArea(51, "<font size='15'><a href='event:closeshop'><b><R>X</R></a>", name, 582, 87, 21, 27, 0x324650, 0x000000, 0, true)
  165.         ui.addTextArea(52, "<font size='15'><p align='center'>"..translations[Data[name].Language].Shop_SCInfor.."", name, 205, 136, 120, 100, 0x314a4a, 0x314a4a, 1, true)
  166.         ui.addTextArea(53, "<font size='15'><p align='center'><a href='event:buy_sc'>"..translations[Data[name].Language].Coins50.."</a>", name, 204, 253, 120, 24, 0x314a4a, 0x314a4a, 1, true)
  167.         ui.addTextArea(54, "<font size='15'><p align='center'>"..translations[Data[name].Language].Shop_JPInfor.."</R>", name, 340, 136, 120, 100, 0x314a4a, 0x314a4a, 1, true)
  168.         ui.addTextArea(55, "<font size='15'><p align='center'><a href='event:buy_jump'>"..translations[Data[name].Language].Coins75.."</R></a>", name, 340, 253, 120, 24, 0x314a4a, 0x314a4a, 1, true)
  169.         ui.addTextArea(56, "<font size='15'><p align='center'>"..translations[Data[name].Language].Shop_ESInfor.."</R>", name, 475, 136, 120, 100, 0x314a4a, 0x314a4a, 1, true)
  170.         ui.addTextArea(57, "<font size='15'><p align='center'><a href='event:buy_es'>"..translations[Data[name].Language].Coins100.."</a>", name, 475, 253, 120, 24, 0x314a4a, 0x314a4a, 1, true)
  171.         ui.addTextArea(58, "<font size='15'><p align='left'>| "..translations[Data[name].Language].Coins.." "..Data[name].Coins.."", name, 272, 94, 193, 24, 0x314a4a, 0x314a4a, 0, true)
  172.         ui.addTextArea(59, "<font size='14'><p align='left'><J>Level: <R>"..Data[name].Level.."", name, 204, 291, 193, 24, 0x314a4a, 0x314a4a, 0, true)
  173.         ui.addTextArea(60, "<b><a href='event:nextpage1'><R><font size='15'>Next</a>", name, 558, 298, 49, 23, 0x324650, 0x000000, 0, true)
  174.         for i = 70,80 do
  175.             ui.removeTextArea(i,name)
  176.         end
  177.     elseif link == "closeshop" then
  178.         for i = 50,80 do
  179.             ui.removeTextArea(i,name)
  180.         end
  181.     elseif link == "nextpage1" then
  182.         ui.addTextArea(70, "<p align='left'><font size='25'>"..translations[Data[name].Language].Shop.."</font></p>", name, 195, 87, 412, 234, 0x313a4a, 0x313a4a, 1, true)
  183.         ui.addTextArea(71, "<font size='15'><a href='event:closeshop'><b><R>X</R></a>", name, 582, 87, 21, 27, 0x324650, 0x000000, 0, true)
  184.         ui.addTextArea(72, "<font size='15'><p align='center'>"..translations[Data[name].Language].Shop_VPInfor.."", name, 205, 136, 120, 100, 0x314a4a, 0x314a4a, 1, true)
  185.         ui.addTextArea(73, "<font size='15'><p align='center'><a href='event:buy_vp'>"..translations[Data[name].Language].Coins200.."</a>", name, 204, 253, 120, 24, 0x314a4a, 0x314a4a, 1, true)
  186.         ui.addTextArea(74, "<font size='15'><p align='center'>???</R>", name, 340, 136, 120, 100, 0x314a4a, 0x314a4a, 1, true)
  187.         ui.addTextArea(75, "<font size='15'><p align='center'>???</R></a>", name, 340, 253, 120, 24, 0x314a4a, 0x314a4a, 1, true)
  188.         ui.addTextArea(76, "<font size='15'><p align='center'>???</R>", name, 475, 136, 120, 100, 0x314a4a, 0x314a4a, 1, true)
  189.         ui.addTextArea(77, "<font size='15'><p align='center'>???</a>", name, 475, 253, 120, 24, 0x314a4a, 0x314a4a, 1, true)
  190.         ui.addTextArea(78, "<font size='15'><p align='left'>| "..translations[Data[name].Language].Coins.." "..Data[name].Coins.."", name, 272, 94, 193, 24, 0x314a4a, 0x314a4a, 0, true)
  191.         ui.addTextArea(79, "<font size='14'><p align='left'><J>Level: <R>"..Data[name].Level.."", name, 204, 291, 193, 24, 0x314a4a, 0x314a4a, 0, true)
  192.         ui.addTextArea(80, "<b><a href='event:shop'><R><font size='15'>Back</a>", name, 558, 298, 49, 23, 0x324650, 0x000000, 0, true)     
  193.         for i = 50,60 do
  194.             ui.removeTextArea(i,name)
  195.         end
  196.     elseif link == "buy_sc" then
  197.         if Data[name].Coins >= 50 then
  198.             Data[name].Coins = Data[name].Coins - 50
  199.             Data[name].Second_Chance = Data[name].Second_Chance + 3
  200.             tfm.exec.chatMessage(""..translations[Data[name].Language].Buy_SC.."",name)
  201.         else
  202.             tfm.exec.chatMessage(""..translations[Data[name].Language].NoMoney.."",name)
  203.         end
  204.         for i = 50,80 do
  205.             ui.removeTextArea(i,name)
  206.         end
  207.     elseif link == "usage_sc" then
  208.         tfm.exec.respawnPlayer(name)
  209.         Data[name].Second_Chance = Data[name].Second_Chance - 1
  210.         Data[name].Usage_SecondC = true
  211.         ui.removeTextArea(13,name)
  212.         tfm.exec.chatMessage("<VP>You have another "..Data[name].Second_Chance.." second chances",name)
  213.     elseif link == "buy_jump" then
  214.         if Data[name].Coins >= 75 then
  215.             Data[name].Activated_Jump = true
  216.             Data[name].Coins = Data[name].Coins - 75
  217.             tfm.exec.chatMessage(""..translations[Data[name].Language].Buy_JP.."",name)
  218.         else
  219.             tfm.exec.chatMessage(""..translations[Data[name].Language].NoMoney.."",name)
  220.         end
  221.         for i = 50,80 do
  222.             ui.removeTextArea(i,name)
  223.         end
  224.     elseif link == "buy_es" then
  225.         if Data[name].Coins >= 100 then
  226.             Data[name].Coins = Data[name].Coins - 100
  227.             Data[name].ChangesSize = Data[name].ChangesSize + 3
  228.             ui.addTextArea(14, "<font size='15'><b><p align='center'><CH><a href='event:doubleSize'>Double size</a></p>", name, 652, 355, 138, 31, 0x315250, 0xc74949, 0.5, true)
  229.             Data[name].Buyed_CS = true
  230.             tfm.exec.chatMessage(""..translations[Data[name].Language].Buy_ES.."",name)
  231.         else
  232.             tfm.exec.chatMessage(""..translations[Data[name].Language].NoMoney.."",name)           
  233.         end
  234.         for i = 50,80 do
  235.             ui.removeTextArea(i,name)
  236.         end
  237.     elseif link == "doubleSize" then
  238.         if Data[name].Activated_CS == false then
  239.             Data[name].ChangesSize = Data[name].ChangesSize - 1
  240.             tfm.exec.changePlayerSize(name,1.8)
  241.             Data[name].Activated_CS = true
  242.             removeTextAreaChangeSize(name)
  243.             tfm.exec.chatMessage(""..translations[Data[name].Language].Usage_ES..""..Data[name].ChangesSize.."",name)          
  244.         end
  245.     elseif link == "buy_vp" then
  246.         if Data[name].Coins >= 200 then
  247.             Data[name].Coins = Data[name].Coins - 200
  248.             Data[name].Activated_Vampire = true
  249.             Data[name].Buyed_VP = true
  250.             tfm.exec.setVampirePlayer(name)
  251.             tfm.exec.setNameColor(name,0xff0000)
  252.             tfm.exec.chatMessage(""..translations[Data[name].Language].Buy_VP.."",name)
  253.             settingsKeyboard(name)
  254.         else
  255.             tfm.exec.chatMessage(""..translations[Data[name].Language].NoMoney.."",name)                       
  256.         end
  257.         for i = 50,80 do
  258.             ui.removeTextArea(i,name)
  259.         end    
  260.     elseif link == "help" then
  261.     tfm.exec.chatMessage(""..translations[Data[name].Language].Help.."",name)
  262.     end
  263. end
  264.  
  265. -- Settings keyboard
  266. settingsKeyboard = function(name)
  267.   if k == 32 and tfm.get.room.playerList[name].isFacingRight == true and info[name].time < os.time()-1500 then
  268.     info[name].time = os.time()
  269.     tfm.exec.movePlayer(name,0,0,true,100,0,false)
  270.   elseif k == 32 and tfm.get.room.playerList[name].isFacingRight == false and info[name].time < os.time()-1500 then
  271.     info[name].time = os.time()
  272.     tfm.exec.movePlayer(name,0,0,true,-100,0,false)
  273.   end
  274. local facingLeft = {} -- Create a table facing left
  275. for name in pairs(tfm.get.room.playerList) do
  276.   for _,key in pairs{0,2,3,32,40,74,75} do system.bindKeyboard(name, key, true)
  277.     end
  278. end
  279. eventKeyboard = function(name, key, down, x, y)
  280.     if key == 0 or key == 2 then
  281.             facingLeft[name] = key == 0
  282.     elseif key == 32 then
  283.         if Data[name].Activated_Jump == true then -- Verify that the "jump" power is = a true. Which means it has been activated.
  284.             if Data[name].Jump < 3 then
  285.                 tfm.exec.movePlayer(name,0,-1,true,0,-49,false)
  286.                 Data[name].Jump = Data[name].Jump + 1 -- The variable increases its value each time the player presses the key to reach the limit.
  287.                 tfm.exec.chatMessage(""..translations[Data[name].Language].Jumps..""..Data[name].Jump.."",name)
  288.             else
  289.                 Data[name].Activated_Jump = false -- If the value has already been exceeded the variable that "unlocks" receives the value of false to "block".
  290.                 tfm.exec.chatMessage(""..translations[Data[name].Language].JumpLimites.."",name)
  291.             end
  292.         end
  293.     elseif key == 40 then
  294.         if Data[name].Activated_Vampire == true then
  295.             tfm.exec.movePlayer(name,0,-1,true,0,-49,false)
  296.         end
  297.     end
  298. end
  299. end
  300. --
  301. tfm.exec.newGame(maps[math.random(#maps)])
  302. table.foreach(tfm.get.room.playerList,eventNewPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement