| |
| 0 | ||
Msluvattack a dit : What do you want the NPCs to say / do? |
| « Citoyen » 1494416520000
| 0 | ||
| Sorry if this is the wrong place to say this but: i kind of feel that someone here has the skill to make a mafia/werewolf/town of salem module ; p |
| « Citoyen » 1494754020000
| 0 | ||
| Answer these: edit 1. How do I make textarea to only display if when that person triggers it without everyone seeing it. 2. How do i make the person who entered the lua script the admin 3. How do i make something spawn at a different angle if the mouse is facing a different direction 4. Can you show me how i can kill a mouse with space but u have to be standing 5 pixels away or less if you are the killer. Dernière modification le 1494762600000 |
| « Citoyen » 1494754680000
| 0 | ||
Noonicknames a dit : 1. It depends what's you want to show. 2. You can't do that. The person has to enter his nickname directly in the script. Code Lua 1 admin = "ADMIN" --Change ADMIN by your pseudo 3. Code Lua 1 2 name = "Noonicknames" |
| « Citoyen » 1494831660000
| 0 | ||
| Anyone can add Respawn in shop in this code -- AirMatch v1.1b -- Credits: Mawcn admin = "Mawcn" -- you can put ur nick here cash = {} countdown = 6 item = {} maps = {7009353, 7009355} players = {} tfm.exec.disableAutoNewGame() tfm.exec.disableAutoShaman() tfm.exec.newGame(maps[math.random(#maps)]) function eventNewGame() countdown = 6 started = false tfm.exec.setUIMapName("<J>"..countdown.."...\n") end function eventNewPlayer(pN) item[pN] = 0 players[pN] = {timestamp = os.time()} tfm.exec.bindKeyboard(pN, 32, true, true) for n, kC in pairs({40}) do tfm.exec.bindKeyboard(pN, kC, true, true) end system.bindMouse(pN, true) if pN == admin then cash[pN] = 888888 else cash[pN] = 0 end ui.addTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) ui.addTextArea(1, "<a href = 'event:derollshop'>Shop! ▼", pN, 9, 28, 100, 20, 0x111111, 0x111111, 1, true) end function eventLoop(eT, rT) if eT >= 6000 and not started then started = true end countdown = countdown - 1 tfm.exec.setUIMapName("<J>"..countdown.."...\n") if countdown <= 0 then tfm.exec.setUIMapName("<J>Fight!\n") end for pN in pairs(tfm.get.room.playerList) do cash[pN] = cash[pN] + 1 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end end function eventKeyboard(pN, kC, down, x, y) if kC == 32 then tfm.exec.movePlayer(pN, 0, 0, true, 0, -50, false) elseif kC == 40 and item[pN] == 0 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(17, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() elseif kC == 40 and item[pN] == 1 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(1701, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() elseif kC == 40 and item[pN] == 2 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(1703, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() elseif kC == 40 and item[pN] == 3 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(1702, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() elseif kC == 40 and item[pN] == 4 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(1704, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() elseif kC == 40 and item[pN] == 5 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(1705, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() elseif kC == 40 and item[pN] == 6 and players[pN].timestamp < os.time() - 750 then tfm.exec.addShamanObject(1706, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270) players[pN].timestamp = os.time() end end function eventPlayerDied(pN) local aM = 0 local pN2 for n, p in pairs(tfm.get.room.playerList) do if not p.isDead then aM = aM + 1 pN2 = n end end if aM == 1 then tfm.exec.giveCheese(pN2) tfm.exec.playerVictory(pN2) tfm.exec.setGameTime(5) tfm.exec.newGame(maps[math.random(#maps)]) end end function eventTextAreaCallback(id, pN, answer) if answer == "derollshop" then ui.addTextArea(1, "<a href = 'event:rollshop'>Shop! ▲</a>\n-> <a href = 'event:glassed'>Glassed cannon - 250 coins</a>\n-> <a href = 'event:ornament'>Ornament cannon - 250 coins</a>\n-> <a href = 'event:lollipop'>Lollipop cannon - 300 coins</a>\n-> <a href = 'event:angel'>Angel cannon - 350 coins</a>\n-> <a href = 'event:apple'>Apple cannon - 350 coins</a>\n-> <a href = 'event:watermelon'>Watermelon cannon - 500 coins</a>", pN, 9, 27, 205, 100, 0x111111, 0x111111, 1, true) elseif answer == "rollshop" then ui.addTextArea(1, "<a href = 'event:derollshop'>Shop! ▼", pN, 9, 28, 100, 20, 0x111111, 0x111111, 1, true) elseif answer == "glassed" then if cash[pN] >= 250 then item[pN] = 1 cash[pN] = cash[pN] - 250 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end elseif answer == "ornament" then if cash[pN] >= 250 then item[pN] = 2 cash[pN] = cash[pN] - 250 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end elseif answer == "lollipop" then if cash[pN] >= 300 then item[pN] = 3 cash[pN] = cash[pN] - 300 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end elseif answer == "angel" then if cash[pN] >= 350 then item[pN] = 4 cash[pN] = cash[pN] - 350 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end elseif answer == "apple" then if cash[pN] >= 350 then item[pN] = 5 cash[pN] = cash[pN] - 350 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end elseif answer == "watermelon" then if cash[pN] >= 500 then item[pN] = 6 cash[pN] = cash[pN] - 500 ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true) end end end for pN in pairs(tfm.get.room.playerList) do eventNewPlayer(pN) end |
| 0 | ||
| I'm trying to figure out how to remove a text area at a certain time. The timer is counting up so when it gets to 15 seconds it pops up, I want it to disappear at 18 seconds. |
| 0 | ||
Bradmouser a dit : Code Lua 1 2 3 4 5 6 7 8 9 function eventLoop(passed, left) Dernière modification le 1495397160000 |
| 0 | ||
Onkei a dit : What if there's already an eventLoop? |
| 0 | ||
Bradmouser a dit : You put the inside code from the eventLoop I gave you to the original one you have. Having two events / functions will overwrite each other. |
| « Censeur » 1495723500000
| 0 | ||
| Hello i need help in edit my script i want add king of blue team king of red team and i want add skills for the kings tfm.exec.disableAutoShaman(true) tfm.exec.newGame(7154149) tfm.exec.disableAfkDeath(false) local red = {} local blue = {} local mice = {} local range = 50 function eventNewGame() local playerList={} for playerName,player in pairs(tfm.get.room.playerList) do table.insert(playerList,playerName) end for i=1,#playerList,1 do local index=math.random(#playerList) local playerName=playerList[index] if i%2==0 then table.insert(red,playerName) tfm.exec.setNameColor(playerName, 0xDE2929) tfm.exec.movePlayer(playerName,90,45,false,0,50,false) else table.insert(blue,playerName) tfm.exec.setNameColor(playerName, 0x1026E1) tfm.exec.movePlayer(playerName,1210,45,false,0,50,false) end table.remove(playerList,index) end end function eventNewPlayer(playerName) if not mice[playerName] then mice[playerName] = {x=0, y=0} end for _,key in pairs({0,1,2,3,32}) do tfm.exec.bindKeyboard(playerName, key, true, true) end ui.addTextArea(0, "<p align='center'><font color='#babd2f' size='50' face='Soopafresh'>Ocean of fish", nil, 8, 28, 786, 192, 0x324650, 0x000000, 0, true) end function pythag(x1, y1, x2, y2, r) local x = x2 - x1 local y = y2 - y1 local r = r + r return x * x + y * y < r * r end function eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition) mice[playerName].x, mice[playerName].y = xPlayerPosition, yPlayerPosition if keyCode == 32 then for n in pairs(mice) do if pythag(xPlayerPosition, yPlayerPosition, mice[n].x, mice[n].y, range) and playerName ~= n then tfm.exec.killPlayer(n) end end end end table.foreach(tfm.get.room.playerList, eventNewPlayer) function makeTeams() local playerList={} for playerName,player in pairs(tfm.get.room.playerList) do table.insert(playerList,playerName) end for i=1,#playerList,1 do local index=math.random(#playerList) local playerName=playerList[index] if i%2==0 then table.insert(red,playerName) tfm.exec.setNameColor(playerName, 0xDE2929) tfm.exec.movePlayer(playerName,90,45,false,0,50,false) tfm.exec.addImage("bi8oHEU.png","%"..playerName,-21,-30) else table.insert(blue,playerName) tfm.exec.setNameColor(playerName, 0x1026E1) tfm.exec.movePlayer(playerName,1210,45,false,0,50,false) end table.remove(playerList,index) end end function eventPlayerDied(playerName) local blueCount,redCount=#blue,#red for i=1,#blue do if tfm.get.room.playerList[blue].isDead then blueCount=blueCount-1 end end for i=1,#red do if tfm.get.room.playerList[red].isDead then redCount=redCount-1 end end if blueCount==0 then for i=1,#red do tfm.exec.respawnPlayer(red) tfm.exec.giveCheese(red) tfm.exec.playerVictory(red) end end if redCount==0 then for i=1,#blue do tfm.exec.respawnPlayer(blue) tfm.exec.giveCheese(blue) tfm.exec.playerVictory(blue) end end end makeTeams() Dernière modification le 1495724220000 |
| « Consul » 1495874040000
| 0 | ||
| How can I attribute a field skill? For example when you put on a wood to dance How can I make an area text just come after me? For example, I want a text that can do something like "dancing," and when you hit dancing, just come after me on the map and stay where I set it Dernière modification le 1495893120000 |
| « Citoyen » 1496355180000
| 0 | ||
| I need help with making a project with lua, the idea is something similar to town of salem. I dont know if this is possible but if you can i'd be grateful ^^ |
| « Consul » 1496389080000
| 1 | ||
Borntolol a dit : I have an idea similar to TOS already. But I am LAZY! Dernière modification le 1496389140000 |
| 0 | ||
Honorabilis a dit : We can work on it together if you want :D |
| « Consul » 1496397060000
| 0 | ||
Onkei a dit : Oh, summer holiday is coming! So, why not? :P |
| 0 | ||
| the script of the new event? |
| « Consul » 1496497680000
| 0 | ||
| Does somebody have that script in which you press a button and you collect an object (press space and dance)? Dernière modification le 1496560140000 |
| « Citoyen » 1496571240000
| 0 | ||
Dramatotala a dit : ui.addTextArea(2, "<a href='event:Test'>Click Me</a>", nil, 400, 200, 61, 20, 0xff0000, 0x000000, 0.3, false) function eventTextAreaCallback(id, name, cb) if cb == "Test" then -- if player clicks on button with that callback name print (name .. " clicked on the button.") end end Just replace Test with something else and put in different text by replacing Click Me with something else Dernière modification le 1496571360000 |
| « Citoyen » 1497072300000
| 0 | ||
| I need help to make a killing system so that if you are the police and press space 5 pixels or nearer away from the murderer he'll die. Currently: police = "Noonicknames" murderer = "Souris" tfm.exec.bindKeyboard(police, 32, true, true) function eventKeyboard(name, key, down, x, y) if key == 32 then if name == police then policeP = true policeX = x policeY = y end if policeP == true then if name == murderer then for i = (policeY - 5), 10, 1 do if i == y then killMX = true end end for i = (policeX - 5), 10, 1 do if i == x then killMY = true end end end end end if killMX == true and killMY == true then tfm.exec.killPlayer(murderer) end killMX = false killMY = false policeP = false policeX = nil policeY = nil end |