Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --RIDDLE
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- cmds={"mod","word","cheat","respawn","staff"}
- for _,cmd in pairs(cmds) do
- system.disableChatCommandDisplay(cmd)
- end
- admins={"Safwanrockz","Shamousey"}
- words={"cheese","ice","fire","llama","pony","hot","ditch","monkey","shaman","mouse","feather","cookie","music","donut","conscience","explosion","ear","eagle","dubstep","heat","pit","DNA","football","eyepatch","poor","record","recycle","hat","pen","pumpkin","rice","noodles","song","soccer","sonic","sparkle","unicycle","bicycle","tricycle","wedding","virus","emo","goat","sheep","lamb","buffalo","basketball","egg","frog","elevator","oasis","nightingale","leather","jail","lyrics","MacBook","scarf","summer","rainbow","tattoo","seafood","soda","Pepsi","Nemo","America","FireFox"}
- maps={"@4411282"}
- function table.random(t, associative)
- associative = associative or false
- if associative then
- local t2 = {}
- for k in pairs(t) do
- t2[#t2 + 1] = k
- end
- return t[table.random(t2)]
- else
- return t[math.random(1,#t)]
- end
- end
- function table.contains(t,element)
- if element==nil then
- return false
- end
- for key,value in pairs(t) do
- if value==element then
- return true
- end
- end
- return false
- end
- for player in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore (player, 0)
- end
- tfm.exec.newGame(table.random(maps))
- function eventNewGame()
- ui.addTextArea(0, "<p align='center'>Welcome to <font color='#ff0000'><B>Riddle</B></font> minigame! Type <font color='#ff0000'><B>!help</B></font> for help.</p>", name, 255, 19, nil, nil, "0x262626", "0x000000", 0.7, nil)
- shaman=nil
- for name,player in pairs(tfm.get.room.playerList) do
- if(tfm.get.room.playerList[name].isShaman) then
- shaman=name
- end
- end
- answered=false
- lastnew=false
- word=table.random(words)
- tfm.exec.setUIMapName("<VP>~Made by Safwanrockz")
- tfm.exec.setGameTime(105,true)
- ui.addTextArea(1, "<BV>You have to make a riddle of the word.. \n<J><B>"..word.."</B></J>\nYou have 2 minutes!", shaman, 5, 20, nil, nil, "0x262626", "0x000000", 0.7, nil)
- end
- function evenNewPlayer(name)
- ui.updateTextArea(0, "<p align='center'>Welcome to <font color='#ff0000'><B>Riddle</B></font> minigame! Type <font color='#ff0000'><B>!help</B></font> for help.</p>", name, 275, 19, nil, nil, "0x262626", "0x000000", 0.7, nil)
- tfm.exec.respawnPlayer(name)
- end
- function eventChatCommand(name,cmd)
- local arg={}
- for argument in cmd:gmatch("[^%s]+") do
- table.insert(arg, argument);
- end
- if cmd:lower()==word:lower() and name~=shaman and not answered then
- ui.removeTextArea(5)
- ui.addTextArea(0, "<J>"..name.."<BV> has solved the riddle! The word was <J>"..word.."</J>", nil, 255, 19, nil, nil, "0x262626", "0x000000", 0.7, nil)
- tfm.exec.giveCheese(name)
- tfm.exec.playerVictory(name)
- answered=true
- tfm.exec.setPlayerScore(name,5)
- tfm.exec.setGameTime(5,true)
- tfm.exec.setPlayerScore(shaman,0)
- elseif cmd=="help" then
- ui.removeTextArea(4)
- ui.addTextArea(3, "<p align='center'><font color='#ff0000' size='13' face='Soopafresh'>Welcome to Riddle minigame!</font></p><br><br>Your goal as a shaman is to make a riddle out of the word you get.<br>Your goal as a mouse is to guess the riddle the shaman is making.<br><br><p align='center'><font color='#ff0000' size='13' face='Soopafresh'>Additional Commands</font></p><br><font color='#ff0000'><B>!next</B></font> as a shaman to skip your turn.<br><font color='#ff0000'><B>!new</B></font> as a shaman to get a new word.<br><font color='#ff0000'><B>!respawn</B></font> to respawn your mouse.<br><font color='#ff0000'><B>!staff</B></font> to view the list of room staff.<br><br><br><br><p align='right'><a href='event:close'><font color='#ff0000' face='Soopafresh'>Close</p></a></font>", name, 289, 76, 230, 250, "0x262626", "0x000000", 0.7)
- elseif cmd=="respawn" then
- tfm.exec.respawnPlayer(name)
- elseif cmd=="staff" then
- ui.removeTextArea(3)
- ui.addTextArea(4, "<p align='center'><font color='#ff0000' size='13' face='Soopafresh'>Room Staff</font> </p><br><br><font color='#ff0000'><B>•</B></font> Safwanrockz<br><font color='#ff0000'><B>•</B></font> Shamousey<br><br><br><br><p align='right'><a href='event:close'><font color='#ff0000' size='13' face='Soopafresh'>Close</p></a></font></B>", name, 329, 156, 130, 130, "0x262626", "0x000000", 0.7)
- end
- if tfm.get.room.playerList[name].isShaman then
- if cmd=="next" then
- answered=true
- tfm.exec.setGameTime(1,true)
- tfm.exec.setPlayerScore(shaman,0)
- ui.updateTextArea(0, "<BV>The shaman has decided to skip their turn! The word was:\n<J>"..word, nil)
- elseif cmd=="new" and not answered and not lastnew then
- word=table.random(words)
- ui.removeTextArea(0)
- ui.addTextArea(5, "<BV>The shaman has chosen a new word!", nil, 295, 19, nil, nil, "0x262626", "0x000000", 0.7, nil)
- ui.updateTextArea(1, "<BV>You have to make a riddle of the word.. \n<J><B>"..word.."</B></J>\nYou have 2 minutes!", shaman)
- lastnew=true
- elseif cmd==word and not answered then
- ui.removeTextArea(5)
- tfm.exec.setPlayerScore(name,0)
- ui.updateTextArea(0, "<R>The shaman has cheated! Beginning a new round..", nil)
- answered=true
- tfm.exec.setGameTime(5,true)
- end
- end
- if table.contains(admins, name) then
- if cmd=="cheat" then
- ui.removeTextArea(0)
- ui.removeTextArea(5)
- ui.addTextArea(6, "<BV>No cheating allowed!", nil, 335, 19, nil, nil, "0x262626", "0x000000", 0.7, nil)
- tfm.exec.setGameTime(5,true)
- answered=true
- elseif cmd:sub(0,3)=="mod" then
- ui.addTextArea(2, "<ROSE>• [~Riddle Mod] "..cmd:sub(5), nil, 5, 377, nil, nil, "0x262626", "0x000000", 0.7, nil)
- elseif arg[1]=="map" then
- tfm.exec.newGame(arg[2])
- elseif cmd=="word" then
- ui.updateTextArea(0, "The word is "..word, name)
- elseif arg[1]=="shaman" then
- tfm.exec.setGameTime(0,true)
- tfm.exec.setPlayerScore(arg[2],1337)
- elseif arg[1]=="admin" then
- table.insert(admins, arg[2])
- end
- end
- end
- function eventTextAreaCallback(textid,name,cb)
- if cb=='close' then
- ui.removeTextArea(3, name)
- ui.removeTextArea(4, name)
- end
- end
- function eventLoop(time,remaining)
- if remaining <= 5000 and not answered then
- ui.removeTextArea(5)
- ui.removeTextArea(6)
- ui.removeTextArea(0)
- ui.addTextArea(7, "<BV>Nobody solved the riddle! The word was <J><B>"..word, nil, 263, 19, nil, nil, "0x262626", "0x000000", 0.7, nil)
- answered=true
- end
- if remaining <= 0 then
- tfm.exec.newGame(table.random(maps))
- answered=false
- ui.removeTextArea(1)
- ui.removeTextArea(2)
- ui.removeTextArea(3)
- ui.removeTextArea(4)
- ui.removeTextArea(5)
- ui.removeTextArea(6)
- ui.removeTextArea(7)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment