| |
| « Sénateur » 1532378040000
| 0 | ||
Syrius a dit : You need to split the string using a pattern. The most commom pattern are the spaces, each white space is an argument. To do so: Code Lua 1 2 3 4 5 6 7 8 9 10 eventChatCommand = function(name, cmd) Dernière modification le 1532378100000 |
| 0 | ||
| ...... Dernière modification le 1532616420000 |
| « Citoyen » 1532421480000
| 0 | ||
| How can you disable the "Mort" Command And also how can you make a TextArea? |
| « Citoyen » 1532421660000
| 0 | ||
Desangres a dit : tfm.exec.disableMortCommand(true) Desangres a dit : ui.addTextArea(1,"Example text to display.",nil,350,180,100,40,0x324650,0x212F36,0.8,true) |
| « Citoyen » 1532602380000
| 0 | ||
Anhtuan123 a dit : Code Lua 1 2 3 4 5 6 7 8 9 10 local equipped = false |
| 0 | ||
| hello how to make a code that when you click it it will make a countdown then loads a map, when you load the map you can shoot a item by clicking s or down arrow |
| « Consul » 1532862780000
| 0 | ||
| Script for game of catch. If catcher overlaps about 50% of the other player, then make the other player catcher, and remove first player as catcher. |
| « Citoyen » 1533348600000
| 0 | ||
| Hi, recently I've been learning how to code on Lua. Can you tell me how I give transform powers? We don't have the module transform on my server. |
| « Sénateur » 1533354960000
| 2 | ||
Campwolf a dit : hey, you can't give transform powers using lua |
| « Citoyen » 1533403380000
| 0 | ||
Bolodefchoco a dit : How did the #transform module get exported? |
| « Sénateur » 1533404460000
| 2 | ||
Campwolf a dit : You need to write it yourself. The module is like: When you press 1, save your current position, kill you and add a shaman object. Press space and remove the shaman object, respawn you and move you to the saved position |
| « Citoyen » 1533415680000
| 0 | ||
Bolodefchoco a dit : Hmm, I don't understand |
| « Sénateur » 1533416940000
| 2 | ||
Campwolf a dit : Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 local player_info = {} |
| « Consul » 1533478200000
| 0 | ||
| Script for textarea's callback to change table's SETUP's value (SETUP.challengemode) to "survival" |
| « Citoyen » 1533496140000
| 0 | ||
Bolodefchoco a dit : Thank you!! |
| « Citoyen » 1534104720000
| 1 | ||
| Someone maybe already did this but, can somebody do a script where: You go on the water, you die? I need to attach it to this script made by Velspar... rh = 400 --The maps height rw = 800 --The maps width speed = 1 --The speed in which the water will rise. ------------------------------ --##Careful with large maps, can become quite laggy if your pc cant handle it. ------------------------------ bn = 0 function eventLoop() bn = bn + speed if bn > rh then bn = 0 end tfm.exec.addPhysicObject(0,rw/2,rh-(bn/2),{ type=9, width=rw, height=bn, foreground=true, miceCollision=false }) end |
| « Sénateur » 1534116660000
| 2 | ||
Themiachale a dit : Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 -- Must not be a vanilla map |
| « Citoyen » 1534119060000
| 0 | ||
Bolodefchoco a dit : I'm sorry but I can't let it work properly... when I run it, it do the normal things that it could do when there wasn't this part of the script, the mice don't die while touching the water... Idk if I need to change something, could you help me more? tfm.exec.disableAfkDeath(true) tfm.exec.disableAutoShaman(true) tfm.exec.newGame("@7493263") -- Must not be a vanilla map local water_grounds = { } eventNewGame = function() water_grounds = { } local xml = (tfm.get.room.xmlMapInfo or { }).xml if xml then local total = 0 string.gsub(xml, "<S (.-)>", function(data) if string.match(data, "T=\"(%d+)\"") == '9' then -- is water local x, y, w, h x = tonumber(string.match(data, "X=\"(%d+)\"")) y = tonumber(string.match(data, "Y=\"(%d+)\"")) w = tonumber(string.match(data, "L=\"(%d+)\"")) h = tonumber(string.match(data, "H=\"(%d+)\"")) if x and y and w and h then -- never trust match total = total + 1 w = w / 2 h = h / 2 water_grounds[total] = { x - w, x + w, y - h, y + h } -- bounds end end end) end end eventLoop = function(currentTime) if currentTime > 3000 then for playerName, playerData in next, tfm.get.room.playerList do if not playerData.isDead then for _, water in next, water_grounds do if playerData.x >= water[1] and playerData.x <= water[2] then if playerData.y >= water[3] and playerData.y <= water[4] then tfm.exec.killPlayer(playerName) end end end end end end end rh = 400 --The maps height rw = 800 --The maps width speed = 3 --The speed in which the water will rise. ------------------------------ --##Careful with large maps, can become quite laggy if your pc cant handle it. ------------------------------ bn = 0 function eventLoop() bn = bn + speed if bn > rh then bn = 0 end tfm.exec.addPhysicObject(0,rw/2,rh-(bn/2),{ type=9, width=rw, height=bn, foreground=true, miceCollision=false }) end This is how I lightly changed the script... e: I found out that it works, but the water that rise is not considered water, how can I change the script to consider it water? Dernière modification le 1534120020000 |
| « Sénateur » 1534120620000
| 3 | ||
| The script detects every single water ground. ^ Code Code Lua 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 local water_grounds = { } Oh.. I just noticed they are not waters in the XML. The script only works in waters that are in the XML :P Dernière modification le 1534120740000 |
| « Citoyen » 1534121640000
| 0 | ||
Bolodefchoco a dit : Oh ok, sorry for wasting your time, thank you anyways :3 |