Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.26 KB | None | 0 0
  1. admins={"Tigrounette", "Melibellule", "Mousetat"}
  2. -- remember to put "," between each name!
  3.  
  4.  
  5. tfm.exec.disableAutoNewGame(true)
  6. tfm.exec.disableAfkDeath(true)
  7. tfm.exec.disableAutoShaman(true)
  8. tfm.exec.disableAutoScore(true)
  9. tfm.exec.newGame("@6411544")
  10.  
  11. players={}--respawn place is 400,320
  12. p={}
  13. timestamp=os.time()
  14. numplayers=0
  15.  
  16. begin=false
  17. answerer="lol"
  18. questioner="lol"
  19. question="lol"
  20. ans="lol"
  21. new=false
  22. restart=false
  23. choose=false
  24. start=true
  25. choosey=false
  26. skip=false
  27. message=""
  28. others={}
  29. summonobject=false
  30. timestamplol={}
  31. answererold=""
  32. one=false
  33. dance=false
  34. mapcomplete=false
  35.  
  36.  
  37. function eventNewPlayer(name)
  38. ui.addTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",name,50,365,700,40,0x324650,0x212F36,0.8,true)
  39. ui.addPopup(999,0,"<p align = 'center'><font size='40' face='impact'>Truth or Dare</font></p><font size='20' color='#FF0000'><b>About the game</b></font><font size='15'>\nEvery game, everyone will have the chance to be the Asker. On the first popup as an asker, u can click 'Yes' to randomize a answerer, or 'No' to type a particular person in room. This is similar for almost all other popups, where 'Yes' is for random and 'No' is for typing out yourself. If you are the asker, you can also type '#(number)' to give the question number of the truth/dare in the random list. There are currently <b>"..#truth.."</b> random truths and <b>"..#dare.."</b> random dares, so if you have any feedback feel free to tell me.\n<font color='#00FF00'>Created by Mousetat</font> \nForum Thread: atelier801.com//topic?f=6&t=814350&p=1 \n</font><font face='impact' size='30'>Type !commands to see the list of commands</font>",name,100,50,600,true)
  40. p[name]={questioners=false, admin=false, spectator=true, ban=false, randomerino=1, out=false, new=false}
  41. local i=0
  42. while i<=#admins do
  43. if name==admins[i] then
  44. p[name].admin=true
  45. end
  46. i=i+1
  47. end
  48. end
  49.  
  50. truth={}--you can follow the format 'truth[number]="question"'
  51. truth[1]="من هو/ هي حبيبك / حبيبتك السرية؟"
  52. truth[2]="ما هو طعامك المفضل؟"
  53. truth[3]="ما نوع الناس / الاشخاص المفضل لديك؟"
  54. truth[4]="ما هي الالعاب التي تلعبها غير ترانس فور مايس؟"
  55. truth[5]="كيف ستبدو عندما تكبر؟"
  56. truth[6]="هل قمت بمص ابهامك و انت صغير؟"
  57. truth[7]="ما نوع الجهاز المحمول خاصتك؟"
  58. truth[8]="هلقمت يوما باتلاق الريح امام اصدقائك او معلميك يوما؟"
  59. truth[9]="اذا قمت باختراق ترانس فور مايس ماذا كنت لتفعل؟"
  60. truth[10]="ما هو الفراء المفضل لديك في ترانس ؟ يجب ان تختار؟"
  61. truth[11]="لما تحب ترانس فور مايس؟"
  62. truth[12]="ما هو اكثر شيء تكرهه في نفسك ؟ او في غيرك ؟"
  63. truth[13]="ما اكثر شيء تحبه في نفسك ؟"
  64. truth[14]="اخبرنا ما اكثر شيء تحبه او تكرره في نفسك , و قل لنا السبب "
  65. truth[15]="لما تحب الشخص في العالم الواقعي و اخبرنا السبب؟"
  66. truth[16]="اخبرنا ما اكثر الاشخاص الذين تكرههم في العالم الواقعي , و اخبرنا لما "
  67. truth[17]="اذا كان لديك فراولة غير محدودة فماذا ستشتري؟"
  68. truth[18]="ماذا ستختار الحياة الطويلة ام , بليار دولار كاش؟"
  69. truth[19]="ما هي لعبتك المفضلة؟"
  70. truth[20]="ما هي اطول مدة لم تقم بالاستحواو فيها ؟"
  71. truth[21]="هل قمت بأكل حشرة من قبل؟"
  72. truth[22]="اذا كانت لديك قوة خارقة فماذا ستفعل ؟"
  73. truth[23]="اذا كنت احد الابطال الخارقين فمن ستكون؟"
  74. truth[24]="اذا كنت حشرة ماذا ستفعل؟"
  75. truth[25]="ما هو نوع المشرفين المفضل لديك؟(Admin/Moderator/Sentinels/Mapcrew/Funcorp)"
  76. truth[26]="ما هو شعورك اتجاهي ؟ هي تحبني؟"
  77. truth[27]="هل رسبت يوما باختبار؟"
  78. truth[28]="كم من الاصدقاء لديك؟"
  79. truth[29]="اذا كنت بليونير فماذا ستفعل طوال الوقت؟"
  80. truth[30]="اذا كنت قائد شيء مميز فماذا ستفعل؟"
  81. truth[31]="ما هو الفريق المفضل لديك؟"
  82. truth[32]="ما هي اغنيتك المفضلة ؟"
  83. truth[33]="اذا كنت مع شخص في هذه الغرفة على جزيرة وحدكما فماذا ستفعل بذلك الشخص ؟ (يتوجب ان يكون داخل الغرفة )ـ"
  84. truth[34]="هل يمكنك ان تهين فقير؟"
  85.  
  86.  
  87. dare={}--you can follow the format 'dare[number]="Dare"'
  88. dare[1]="أتحداك ان تكبت هذه الجملة 10 مرات في احدى غرف En En2: CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE CHARLOTTE"
  89. dare[2]="اتحداك ان تقوم بعمل محادثة خاصة مع مشرف و ان تشتمه."
  90. dare[3]="اتحداك ان تقول لشخص ما تحبه سرا ان تقول له احبك هنا و في هذه الغرفة "
  91. dare[4]="اتحداك ان تقوم بكتابة هذه الكلمة في En/en2 10 مرات : I'M FLOODING REPORT ME!"
  92. dare[5]="اتحداك ان تقوم بالتبليغ عن مشرف بتهمة الغش"
  93. dare[6]="اتحداك ان تنشأ حساب يشابه اسماء المشرفين و ان تقوم بعمل محادثة خاصة مع المشرف الذي قمت بانشاء حساب يشابه اسمه و تقول له : اهلا يا صاح "
  94. dare[7]="اتحداك ان تقول اسمك الحقيقي في الدردشة !و امام الجميع"
  95. dare[8]="اتحداك ان تقوم بالتقاط صورة شخصية لنفسك و ارسالها للجميع ليروها ."
  96. dare[9]="اتحداك ان تقوم بدخول الى غرفة utility و تخريب الغرفة او كما يقولون تهنيج."
  97. dare[10]="اتحداك ان تعطيني كل الكرات التي معك"
  98. dare[11]="اتحداك ان تقوم بتسجيل الدخول و الخروج الان"
  99. dare[12]="اتحداك ان تقول اسم صديقك السري الان و في هذه الغرفة "
  100. dare[13]="اتحداك ان تقوم باعطاء سيلفي لكل شخص في هذه الغرفة و اذا لم لكن معك افعهطهم كرات"
  101. dare[14]="اتحداك ان تقوم بانهاء هذه الخريطة دون غش"
  102. dare[15]="اتحداك ات قكتب /c اسم الستخدم انا احبك , 30 مرة او في دردشة القبيلة"
  103. dare[16]="اتحداك ان تقوم بتقبيلي 10 مرات ,لول"
  104. dare[17]="اتحداك بزواج اقرب الاصدقاء الى قلبك اذا لم تكن متزوجا"
  105. dare[18]="اتحداك ان تعطيني كل كرات الثلج التي لديك ."
  106. dare[19]="اتحداك ات قوم بعمل محادثة خاصة مع مشرف و تقول له :'Ban me!'"
  107. dare[20]="اتحداك ان تقوم بحضن شخص الذي في نفس عمرك في هذه الغرفة "
  108. dare[21]="اتحداك ات تكتب 'انا احمق و غبي!' 10 مرات في غرفة"
  109. dare[22]="اتحداك ات تأكل نملة"
  110. dare[23]="اتحداك ان تتكلم مع مشرف و تقول له !, 'HEY <moderator's name>, I'M DAD'"
  111.  
  112. function eventNewGame()
  113. ui.addTextArea(1,"<b><p align = 'center'><font size='30'>أهلا بلعبة حقيقة ام جرأة</font></p></b>",nil,50,365,700,40,0x324650,0x212F36,0.8,true)
  114. ui.addPopup(999,0,"<p align = 'center'><font size='40' face='impact'>جرأة ام حقيقة</font></p><font size='20' color='#FF0000'><b>معلومات عن اللعبة!</b></font><font size='15'>\nEvery game, هذه لعبة جرأة ام حقيقة اتمنى ان تنال اعجابكم ! في هذه اللعبة تضغط على (نعم) حتى تأتي الاسئلة بشكل عشوائي ! او على (لا) حتى تكتب السؤال او التحدي الخاص بك ! هذا للزي سيتم اختياره لكي يسأل او الذي سيقف في الجهة اليسرى! اما الذي سيقف بالجهة اليمنى فهة الذي عليه ان يجيب على السؤال او يقبل التحدي حيث ان تضغط على نعم لكي تختار الحقيقة او على لا لتختار الجرأة'#(رقم)' <b>"..#truth.."</b> للحقيقة العشوائية <b>"..#dare.."</b> للتحدي العشوائي, اذا كان لديك اي استفسارات الرجاء قولها ل Liiliiith .\n<font color='#00FF00'>Created by Mousetat</font> \nالمنتدى: atelier801.com/topic?f=6&t=829261&p=1#m1 \n</font><font face='impact' size='30'>Type !commands حتى ترى الايعازات</font>",nil,100,50,600,true)
  115. answerer=""
  116. questioner=""
  117. begin=false
  118. start=true
  119. numplayers=0
  120. count=1
  121. one=false
  122. local i=0
  123. for name,player in pairs(tfm.get.room.playerList) do
  124. p[name]={questioners=false, admin=false, spectator=true, ban=false, randomerino=1, out=false, new=false}
  125. players[count]=name
  126. timestamp=os.time()
  127. numplayers=numplayers+1
  128. count=count+1
  129. p[name].spectator=false
  130. p[name].questioners=false
  131. local i=0
  132. while i<=#admins do
  133. if name==admins[i] then
  134. p[name].admin=true
  135. end
  136. i=i+1
  137. end
  138. end
  139. system.disableChatCommandDisplay("t", hidden)
  140. system.disableChatCommandDisplay("admin", hidden)
  141. system.disableChatCommandDisplay("restart", hidden)
  142. system.disableChatCommandDisplay("ban", hidden)
  143. system.disableChatCommandDisplay("skip", hidden)
  144. system.disableChatCommandDisplay("watch", hidden)
  145. system.disableChatCommandDisplay("unban", hidden)
  146. system.disableChatCommandDisplay("unadmin", hidden)
  147. end
  148.  
  149. function eventChatCommand(name,command)
  150. local IDList = {}
  151. if command=="clear" then
  152. for id, object in pairs(tfm.get.room.objectList) do
  153. table.insert(IDList, id)
  154. end
  155. for i, id in pairs(IDList) do
  156. tfm.exec.removeObject(id)
  157. end
  158. end
  159. if command=="s" and p[name].admin==true then
  160. tfm.exec.setShaman(name)
  161. elseif command=="dance" and p[name].admin==true then
  162. for name,player in pairs(tfm.get.room.playerList) do
  163. p[name].randomerino=math.random(1,3)
  164. end
  165. dance=true
  166. elseif command=="danceoff" and p[name].admin==true then
  167. dance=false
  168. elseif command=="mods" then
  169. message=""
  170. for k,v in pairs(tfm.get.room.playerList) do
  171. if p[k].admin==true then
  172. message=message..tostring(k)..", "
  173. end
  174. end
  175. ui.updateTextArea(1, "<p align='center'><b><font size='15'>The moderators are: "..string.sub(message,1,-3)..".</font></b></p>", name)
  176. elseif command=="new" and name==questioner then
  177. if p[name].new==false then
  178. print("true")
  179. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  180. answererold=answerer
  181. answerer=""
  182. choose=true
  183. p[name].new=true
  184. else
  185. ui.updateTextArea(1, "<p align='center'><b><font size='30'>You can only !new ONCE</font></b></p>", nil)
  186. end
  187. elseif command=="join" and p[name].spectator==true then
  188. if p[name].ban==false then
  189. ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..name.." joined the game! :D</font></b></p>", nil)
  190. tfm.exec.respawnPlayer(name)
  191. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  192. p[name].spectator=false
  193. table.insert(players,name)
  194. elseif p[name].ban==true then
  195. ui.updateTextArea(1, "<p align='center'><b><font size='30'>You have been banned, so u cannot join the game :(</font></b></p>", name)
  196. end
  197. elseif command=="skip" and p[name].admin==true then
  198. timestamp=os.time()
  199. skip=true
  200. elseif string.sub(command,0,1) == "t" and p[name].admin==true then
  201. message=string.sub(command,3)
  202. ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~Moderation] "..message.."</font></b></p>", nil)
  203. elseif command=="restart" and p[name].admin==true then
  204. tfm.exec.newGame("@6411544")
  205. elseif string.sub(command,0,5)=="watch" then
  206. if string.sub(command,7)=="" then
  207. p[name].spectator=true
  208. ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..name.." is now a spectator :(</font></b></p>", nil)
  209. ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",name)
  210. if name==questioner or name==answerer then
  211. questioner=""
  212. answerer=""
  213. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  214. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  215. timestamp=os.time()
  216. skip=true
  217. end
  218. for i=1,#players do
  219. if players[i]==name then
  220. table.remove(players,i)
  221. end
  222. end
  223. else
  224. if p[name].admin==true then
  225. message=string.sub(command,7)
  226. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  227. for k,v in pairs(tfm.get.room.playerList) do
  228. if k==message and p[k].spectator==false then
  229. if k==questioner or k==answerer then
  230. skip=true
  231. timestamp=os.time()
  232. end
  233. p[k].spectator=true
  234. ui.updateTextArea(1, "<p align='center'><b><font size='30'>"..k.." is now a spectator :(</font></b></p>", nil)
  235. ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",k)
  236. for i=1,#players do
  237. if players[i]==k then
  238. table.remove(players,i)
  239. end
  240. end
  241. end
  242. end
  243. end
  244. end
  245. elseif command=="help" then
  246. ui.addPopup(999,0,"<p align = 'center'><font size='40' face='impact'>Truth or Dare</font></p><font size='20' color='#FF0000'><b>About the game</b></font><font size='15'>\nEvery game, everyone will have the chance to be the Asker. On the first popup as an asker, u can click 'Yes' to randomize a answerer, or 'No' to type a particular person in room. This is similar for almost all other popups, where 'Yes' is for random and 'No' is for typing out yourself. If you are the asker, you can also type '#(number)' to give the question number of the truth/dare in the random list. There are currently <b>"..#truth.."</b> random truths and <b>"..#dare.."</b> random dares, so if you have any feedback feel free to tell me.\n<font color='#00FF00'>Created by Mousetat</font> \nForum Thread: atelier801.com//topic?f=6&t=814350&p=1 \n</font><font face='impact' size='30'>Type !commands to see the list of commands</font>",name,100,50,600,true)
  247. elseif command=="commands" then
  248. if p[name].admin==true then
  249. ui.addPopup(999,0,"<b><font size='20' color='#FFFF00'>COMMANDS</font>\n!join to join the game if you are spectating or you just came into the room.\n!watch to be a spectator and get ignored in the game.\n!mods to see the current moderators in the room.\n!clear to clear all shaman objects.\n!new to get a new answerer(only new ONCE)(asker only)\n!help to see the information about game\n<font size='20' color='#EB1D51'>ADMIN COMMANDS</font>\n!watch (username) to make the username a spectator.\n!s to become shaman\n!admin (username) to admin a person\n!dance/!danceoff to toggle dancing\n!t (message) to speak to all\n!restart to restart game if bugged\n!skip to skip a person's turn\n!ban (username) (reason) to ban a person(highly not advised)</b>",name,100,50,600,true)
  250. elseif p[name].admin==false then
  251. ui.addPopup(999,0,"<b><font size='20' color='#FFFF00'>COMMANDS</font>\n!join to join the game if you are spectating or you just came into the room.\n!watch to be a spectator and get ignored in the game.\n!mods to see the current moderators in the room.\n!clear to clear all shaman objects.\n!new to get a new answerer(only new ONCE)(asker only)\n!help to see the information about game",name,100,50,600,true)
  252. end
  253. elseif string.sub(command,0,3)=="ban" and p[name].admin==true then
  254. local c=0
  255. local reason=""
  256. if string.find(command," ",5)==nil then
  257. message=string.sub(command,5)
  258. else
  259. c=string.find(command," ",5)
  260. print(c)
  261. message=string.sub(command,5,c-1)
  262. reason=string.sub(command,c+1)
  263. print(reason)
  264. end
  265. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  266. for k,v in pairs(tfm.get.room.playerList) do
  267. if message==k then
  268. ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~Moderation] "..message.." has been banned for 9999 hours. Reason: "..reason.."</font></b></p>", nil)
  269. p[message].ban=true
  270. tfm.exec.killPlayer(k)
  271. for i=1,#players do
  272. if players[i]==k then
  273. table.remove(players,i)
  274. end
  275. end
  276. end
  277. end
  278. elseif string.sub(command,0,5)=="unban" and p[name].admin==true then
  279. message=string.sub(command,7)
  280. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  281. for k,v in pairs(tfm.get.room.playerList) do
  282. if message==k then
  283. ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~Moderation] "..message.." has been unbanned.</font></b></p>", nil)
  284. p[message].ban=false
  285. tfm.exec.respawnPlayer(k)
  286. table.insert(players,k)
  287. end
  288. end
  289. elseif string.sub(command,0,5)=="admin" and p[name].admin==true then
  290. message=string.sub(command,7)
  291. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  292. for k,v in pairs(tfm.get.room.playerList) do
  293. if message==k then
  294. ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~Moderation] "..message.." is now a moderator. Congrats!</font></b></p>", nil)
  295. p[message].admin=true
  296. end
  297. end
  298. elseif string.sub(command,0,7)=="unadmin" and p[name].admin==true then
  299. message=string.sub(command,9)
  300. message=string.upper(string.sub(message,0,1))..string.sub(message,2)
  301. for k,v in pairs(tfm.get.room.playerList) do
  302. if message==k then
  303. ui.updateTextArea(1, "<p align='center'><b><font size='15' color='#ED67EA'>[~Moderation] "..message.." is demoded. What a waste!</font></b></p>", nil)
  304. p[message].admin=false
  305. end
  306. end
  307. end
  308. end
  309.  
  310. function eventLoop(time,remaining)
  311. if dance==true then
  312. for name,player in pairs(tfm.get.room.playerList) do
  313. if p[name].randomerino==1 then
  314. tfm.exec.playEmote(name,0,nil)
  315. elseif p[name].randomerino==2 then
  316. tfm.exec.playEmote(name,15,nil)
  317. elseif p[name].randomerino==3 then
  318. tfm.exec.playEmote(name,16,nil)
  319. end
  320. end
  321. end
  322. numplayers=#players
  323. for k,v in pairs(tfm.get.room.playerList) do
  324. if p[k].ban==true then
  325. ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>You have been banned. :(</font></p></b>",k)
  326. elseif p[k].spectator==true then
  327. ui.updateTextArea(1,"<b><p align = 'center'><font size='30'>Type !join to join the game.</font></p></b>",k)
  328. end
  329. end
  330. local IDList={}
  331. for id, object in pairs(tfm.get.room.objectList) do
  332. table.insert(IDList, id)
  333. end
  334. for i, id in pairs(IDList) do
  335. if others[id].summonobject==true and timestamplol[id]<os.time()-3000 then
  336. tfm.exec.removeObject(id)
  337. others[id].summonobject=false
  338. end
  339. end
  340. if numplayers<2 then
  341. one=true
  342. else
  343. one=false
  344. end
  345. if one==true then
  346. ui.updateTextArea(1, "<p align='center'><b><font size='15'>Minimum of 2 players are needed for this game to proceed.</font></b></p>", nil)
  347. timestamp=os.time()-4000
  348. elseif timestamp < os.time()-10000 and begin==false then
  349. timestamp=os.time()
  350. begin=true
  351. restart=false
  352. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Let's Begin the Game! </font></b></p>", nil)
  353. for name,player in pairs(tfm.get.room.playerList) do
  354. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  355. end
  356. elseif timestamp < os.time()-5000 and begin==false then
  357. local i=1
  358. local long=""
  359. local hname=""
  360. while i<=numplayers do
  361. hname=players[i]
  362. if p[hname].spectator==false and tfm.get.room.playerList[hname].isDead==false and p[hname].out==false then
  363. long=long..tostring(players[i])..", "
  364. end
  365. i=i+1
  366. end
  367. ui.updateTextArea(1, "<p align='center'><b><font size='15'>The participating players are: "..string.sub(long,1,-3)..".</font></b></p>", nil)
  368. elseif timestamp < os.time()-3000 and begin==false and restart==true then
  369. ui.updateTextArea(1, "<p align='center'><b><font size='20'>Since everyone had their turn, I'll restart the game...", nil)
  370. end
  371. if begin==true then
  372. if timestamp < os.time()-3000 and start==true then
  373. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  374. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  375. answerer=""
  376. questioner=""
  377. local j=1
  378. local i=0
  379. while j<=numplayers do
  380. pname=players[j]
  381. if p[pname].questioners==false and tfm.get.room.playerList[pname].isDead==false and p[pname].spectator==false and p[pname].out==false then
  382. i=i+1
  383. end
  384. j=j+1
  385. end
  386. if i>0 then
  387. eventTruthOrDare()
  388. else
  389. local j=1
  390. while j<=numplayers do
  391. local name=players[j]
  392. p[name].questioners=false
  393. j=j+1
  394. end
  395. restart=true
  396. timestamp=os.time()
  397. begin=false
  398. end
  399. end
  400. if choose==true and one==false then
  401. rand=math.random(1,numplayers)
  402. answerer=players[rand]
  403. if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or answerer==answererold or p[answerer].out==true then
  404. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  405. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  406. answerer=""
  407. else
  408. choose=false
  409. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." is now the answerer! Waiting to pick truth or dare...</font></b>", nil)
  410. ui.addPopup(3,1,"You are the answerer! Do you want Truth? If No, you will choose Dare!",answerer,250,50,300,true)
  411. end
  412. elseif choosey==true and one==false then
  413. rand=math.random(1,numplayers)
  414. questioner=players[rand]
  415. if p[questioner].questioners==false and tfm.get.room.playerList[questioner].isDead==false and p[questioner].spectator==false or p[questioner].out==false then
  416. choosey=false
  417. p[questioner].questioners=true
  418. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." انت الان هو السائل في الانتظار الرد...</font></b>", nil)
  419. ui.addPopup(1,1,"هل تريد مستجوب عشوائي اذا <b>لا</b>,يتوجب عليك كتابة اسم ذلك اللاعب",questioner,250,50,300,true)
  420. else
  421. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Randomizing...</font></b></p>", nil)
  422. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  423. questioner=""
  424. end
  425. end
  426. if skip==true then
  427. ui.updateTextArea(1, "<p align='center'><b><font size='30'>Skipping turn...</font></b></p>", nil)
  428. tfm.exec.movePlayer(questioner,400,320,false,0,0,false)
  429. tfm.exec.movePlayer(answerer,400,320,false,0,0,false)
  430. answerer=""
  431. questioner=""
  432. if timestamp < os.time()-3000 then
  433. start=true
  434. skip=false
  435. end
  436. end
  437. tfm.exec.movePlayer(questioner,120,120,false,0,0,false)
  438. tfm.exec.movePlayer(answerer,680,120,false,0,0,false)
  439. end
  440. end
  441.  
  442. function eventTruthOrDare()
  443. start=false
  444. ui.removeTextArea(2)
  445. ui.removeTextArea(3)
  446. choosey=true
  447. end
  448.  
  449. function eventPopupAnswer(id, name, answer)
  450. if id==1 and name==questioner then
  451. if answer=="yes" then
  452. answererold=""
  453. choose=true
  454. elseif answer=="no" then
  455. ui.addPopup(2,2,"من الذي تريد ان يكون المفعول به؟",questioner,250,50,300,true)
  456. end
  457. elseif id==2 and name==questioner then
  458. x=1
  459. found=false
  460. answer=string.upper(string.sub(answer,0,1))..string.sub(answer,2)
  461. answer=string.gsub(answer, "<", "&lt;")
  462. answer=string.gsub(answer, "http", "")
  463. while x<=numplayers do
  464. print(players[x])
  465. if answer==players[x] then
  466. answerer=answer
  467. if questioner==answerer or tfm.get.room.playerList[answerer].isDead or p[answerer].spectator==true or p[answerer].out==true then
  468. answerer=""
  469. found=false
  470. else
  471. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." هو الان المفعول به! في الانتظار ماذا سيختار...</font></b>", nil)
  472. ui.addPopup(3,1,"انت الان المفعول به هل تريد حقيقة ؟ اذا<b>لا</b>, اذا ستختار الجرأة!",answerer,250,50,300,true)
  473. found=true
  474. end
  475. end
  476. x=x+1
  477. end
  478. if found==false then
  479. ui.addPopup(2,2,"لا ن عليك كتابة الشخص الذي ستتحداه او الذي ستوجه له الاسئلة يتوجب ان يكون احد داخل الغرفة.",questioner,250,50,300,true)
  480. end
  481. elseif id==3 and name==answerer then
  482. if answer=="yes" then
  483. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." لقد اختار الحقيقة "..questioner.."...</font></b>", nil)
  484. ui.addPopup(4,1,"هل تريد سؤال عغشوائي؟ اذا <b>لا</b>, يجب عليك كتابة السؤال الخاص بك.",questioner,250,50,300,true)
  485. elseif answer=="no" then
  486. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." لقد اختار التحدي في الانتظار "..questioner.."...</font></b>", nil)
  487. ui.addPopup(5,1,"هل تريد تحدي عشوائي؟ اذا <b>لا</b>, اذا عليك كتابة التحدي الخاص بك.",questioner,250,50,300,true)
  488.  
  489. end
  490. elseif id==4 and name==questioner then
  491. if answer=="yes" then
  492. question=truth[math.random(1,#truth)]
  493. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." لقد تم اختيار السؤال في انتظار "..answerer.." لرد...</font></b>", nil)
  494. ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  495. ui.addPopup(8,2,"<b>Type your Truth answer below</b>",answerer,250,175,300,true)
  496.  
  497. elseif answer=="no" then
  498. ui.addPopup(6,2,"اكتب السؤال الخاص بك لو اكتب #(الرقم) لاجل اختيار احدى الاسئلة الاعشوائية في القائمة.",questioner,250,50,300,true)
  499. end
  500. elseif id==5 and name==questioner then
  501. if answer=="yes" then
  502. question=dare[math.random(1,#dare)]
  503. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has randomed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  504. ui.addTextArea(2,"<b><font size='20'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  505. ui.addPopup(9,1,"<b><font size='15'>Do what "..questioner.."لقد قام المتحدي بتحخديك اضغط على نعم حتى تقبل التحدي!</font><b>",answerer,250,175,300,true)
  506. elseif answer=="no" then
  507. ui.addPopup(7,2,"قم بكتابة التحدي الخاص بك او اكتب, #(الرقم) لاختيار التحدي من خانة التحديات.",questioner,250,50,300,true)
  508. end
  509. elseif id==6 and name==questioner then
  510. answer=string.gsub(answer, "<", "&lt;")
  511. answer=string.gsub(answer, "http", "")
  512. if answer=="" then
  513. ui.addPopup(6,2,"You have to type something as your Truth question.",questioner,250,50,300,true)
  514. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))<=#truth then
  515. question=truth[tonumber(string.sub(answer,2,3))]
  516. ui.updateTextArea(1, "<b><font size='15'>"..questioner.."لقد تم كتابة سؤال الحقيقة في انتظار "..answerer.." لرد...</font></b>", nil)
  517. ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  518. ui.addPopup(8,2,"قم بكتابة سؤالك في الاسفل",answerer,250,175,300,true)
  519. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))>#truth then
  520. ui.addPopup(6,2,"You have to type a Truth question number less than or equal to "..tostring(#truth),questioner,250,50,300,true)
  521. else
  522. question=answer
  523. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Truth question! Waiting for "..answerer.." to respond...</font></b>", nil)
  524. ui.addTextArea(2,"<b><font size='20'>Truth: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  525. ui.addPopup(8,2,"Type your Truth answer below",answerer,250,175,300,true)
  526. end
  527. elseif id==7 and name==questioner then
  528. answer=string.gsub(answer, "<", "&lt;")
  529. answer=string.gsub(answer, "http", "")
  530. if answer=="" then
  531. ui.addPopup(7,2,"يجب عليك كتابة شيء لتحدي.",questioner,250,50,300,true)
  532. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))<=#dare then
  533. if tonumber(string.sub(answer,2,3))==14 then
  534. mapcomplete=true
  535. end
  536. question=dare[tonumber(string.sub(answer,2,3))]
  537. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  538. ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  539. ui.addPopup(9,1,"<b><font size='15'>Do what "..questioner.."انه يتحداك اضعط على نعم لتقبل التحدي</font><b>",answerer,250,175,300,true)
  540. elseif string.sub(answer,0,1)=="#" and tonumber(string.sub(answer,2,3))>#dare then
  541. ui.addPopup(7,2,"You have to type a Dare number less than or equal to "..tostring(#dare),questioner,250,50,300,true)
  542. else
  543. question=answer
  544. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." has typed a Dare question! Waiting for "..answerer.." to respond...</font></b>", nil)
  545. ui.addTextArea(2,"<b><font size='15'>Dare: "..question.."</font></b>",nil,165,20,470,120,0x324650,0x212F36,0.8,true)
  546. ui.addPopup(9,1,"<b><font size='15'>Do what "..questioner.."dares you to do! If you click 'yes' you will promise that you will do your dare!</font><b>",answerer,250,175,300,true)
  547. end
  548. elseif id==8 and name==answerer then
  549. answer=string.gsub(answer, "<", "&lt;")
  550. answer=string.gsub(answer, "http", "")
  551. ans = answer
  552. if ans=="" then
  553. ui.addPopup(8,2,"يجب عليك كتابة شيء حقيقي مثل سؤالك",answerer,250,175,300,true)
  554. else
  555. ui.addTextArea(3,"<b><font size='20'>Answer: "..ans.."</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  556. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." لقد قام بالاجابة عن السؤال في انتظار "..questioner.." لتقييم الجواب</font></b>", nil)
  557. ui.addPopup(10,1,"<b><font size='15'>Are you satisfied with the answer?",questioner,250,50,300,true)
  558. end
  559. elseif id==9 and name==answerer then
  560. if answer=="yes" then
  561. ui.addTextArea(3,"<b><font size='20'>I, "..answerer..", وافق على هذا التحدي.</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  562. if mapcomplete==true then
  563. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." هي/هة محارب يجب عليه انهاء الخريطة!. Starting new game...</font></b>", nil)
  564. p[answerer].out=true
  565. mapcomplete=false
  566. for i=1,#players do
  567. if players[i]==answerer then
  568. table.remove(players,i)
  569. end
  570. end
  571. else
  572. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." انه/ا محارب/ة! Starting new game...</font></b>", nil)
  573. end
  574. timestamp=os.time()
  575. answerer=""
  576. questioner=""
  577. start=true
  578. for name,player in pairs(tfm.get.room.playerList) do
  579. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  580. p[name].new=false
  581. print("false")
  582. end
  583. elseif answer=="no" then
  584. mapcomplete=false
  585. ui.updateTextArea(1, "<b><font size='15'>"..answerer.." انه/ا خائف/ه! Starting new game...</font></b>", nil)
  586. ui.addTextArea(3,"<b><font size='20'>I, "..answerer..", انا جبان/ة لا استطيع تنفيذ ما طلبته مني.</font></b>",nil,165,140,470,120,0x324650,0x212F36,0.8,true)
  587. timestamp=os.time()
  588. answerer=""
  589. questioner=""
  590. start=true
  591. for name,player in pairs(tfm.get.room.playerList) do
  592. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  593. p[name].new=false
  594. print("false")
  595. end
  596. end
  597. elseif id==10 and name==questioner then
  598. if answer=="yes" then
  599. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a satisfied with the answer! Starting new game...</font></b>", nil)
  600. timestamp=os.time()
  601. answerer=""
  602. questioner=""
  603. start=true
  604. for name,player in pairs(tfm.get.room.playerList) do
  605. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  606. p[name].new=false
  607. print("false")
  608. end
  609. elseif answer=="no" then
  610. ui.updateTextArea(1, "<b><font size='15'>"..questioner.." is a not satisfied with the answer...:( Starting new game...</font></b>", nil)
  611. timestamp=os.time()
  612. answerer=""
  613. questioner=""
  614. start=true
  615. for name,player in pairs(tfm.get.room.playerList) do
  616. tfm.exec.movePlayer(name,400,320,false,0,0,false)
  617. p[name].new=false
  618. print("false")
  619. end
  620. end
  621. end
  622. end
  623.  
  624. function eventPlayerLeft(name)
  625. ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..name.." left the room... What a coward!</font></b></p>", nil)
  626. if questioner==name or answerer==name then
  627. timestamp=os.time()
  628. skip=true
  629. end
  630. for i=1,#players do
  631. if players[i]==name then
  632. table.remove(players,i)
  633. end
  634. end
  635. end
  636.  
  637. function eventPlayerDied(name)
  638. if p[name].spectator==false then
  639. tfm.exec.respawnPlayer(name)
  640. end
  641. if p[name].ban==true then
  642. tfm.exec.killPlayer(name)
  643. if name==questioner or name==answerer then
  644. timestamp=os.time()
  645. skip=true
  646. end
  647. end
  648. end
  649.  
  650. function eventPlayerWon(playerName,timeElapsed, timeElapsedSinceRespawn)
  651. tfm.exec.respawnPlayer(playerName)
  652. if p[playerName].out==true then
  653. p[playerName].out=false
  654. table.insert(players,playerName)
  655. print("yes")
  656. ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..playerName.." completed the map in "..(timeElapsedSinceRespawn/100).." seconds! He/she has joined back the game!</font></b></p>", nil)
  657. else
  658. ui.updateTextArea(1, "<p align='center'><b><font size='15'>"..playerName.." completed the map in "..(timeElapsedSinceRespawn/100).." seconds!</font></b></p>", nil)
  659. end
  660. end
  661.  
  662. function eventSummoningEnd(playerName, objectType, xPosition, yPosition, angle, xSpeed, ySpeed, other)
  663. timestamplol[other.id]=os.time()
  664. others[other.id]={summonobject=true}
  665. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement