×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 29 / 33 › »
Lua Snippets
Behurluy
« Citoyen »
1411029840000
    • Behurluy#0000
    • Profil
    • Derniers messages
    • Tribu
#561
  0
How to change color name
Drgenius
« Citoyen »
1411151700000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#562
  0
behurluy a dit :
How to change color name

Jaackster a dit :


Name Color a dit :

-- Replace my name with yours, and ffffff with the hex code

tfm.exec.setNameColor("Jaackster", 0xffffff)


Emberkitx a dit :
is it possible to make one certain person be able to infinity jump?

e: oh my gosh I think I put this in the wrong thread wow I'm so sorry omg

Yeah, this should probably be in script requests, but I'll respond to your question with a snippet:

Infinite Jumps a dit :

for player in pairs(tfm.get.room.playerList) do
for tableid, num in ipairs({string.byte('W'), 38}) do
tfm.exec.bindKeyboard(player, num, false, true)
end
end

function eventKeyboard(playerName)
tfm.exec.movePlayer(playerName, 0, 0, false, 0, -32, false)
end

Dernière modification le 1412030580000
Drgenius
1411152660000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#563
[Modéré par Sabusha, raison : Accidental double post]

Dernière modification le 1411429320000
Spartttt
« Citoyen »
1411933380000
    • Spartttt#0000
    • Profil
    • Derniers messages
#564
  0
For some reason, fly doesn't work in tribe.
Drgenius
« Citoyen »
1412069820000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#565
  0
Spartttt a dit :
For some reason, fly doesn't work in tribe.

What is not working? Pressing space does nothing? Is there an error? Does the script load? Please elaborate.
Pmcfarhan
« Citoyen »
1422364200000
    • Pmcfarhan#0000
    • Profil
    • Derniers messages
    • Tribu
#566
  0
How to add speed of a mouse?
Drgenius
« Citoyen »
1422583020000
    • Drgenius#0000
    • Profil
    • Derniers messages
    • Tribu
#567
  0
pmcfarhan a dit :
How to add speed of a mouse?

I responded to you about this here. :)

Dernière modification le 1422583260000
Squirtlspkmn
« Citoyen »
1423222680000
    • Squirtlspkmn#0000
    • Profil
    • Derniers messages
    • Tribu
#568
  0
Shamousey can you give me lua for fly ?
Woebegone
« Citoyen »
1423259640000
    • Woebegone#8377
    • Profil
    • Derniers messages
    • Tribu
#569
  0
squirtlspkmn a dit :
Shamousey can you give me lua for fly ?

It shows it in the OP:

function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,32,true,true)
end

for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end

function eventKeyboard(name,key,down,x,y)
if key==32 then
tfm.exec.movePlayer(name,0,0,true,0,-50,false)
end
end
Squirtlspkmn
« Citoyen »
1423309320000
    • Squirtlspkmn#0000
    • Profil
    • Derniers messages
    • Tribu
#570
  0
1 more question, can u explain the x and y in this script

for name in pairs(tfm.get.room.playerList) do
x = tfm.get.room.playerList[name].x
y = tfm.get.room.playerList[name].y
if x > 885 and x < 1066 and y > 17 and y < 93 then
tfm.exec.setShaman(name)
end
end
Woebegone
« Citoyen »
1423318800000
    • Woebegone#8377
    • Profil
    • Derniers messages
    • Tribu
#571
  0
squirtlspkmn a dit :
1 more question, can u explain the x and y in this script

for name in pairs(tfm.get.room.playerList) do
x = tfm.get.room.playerList[name].x
y = tfm.get.room.playerList[name].y
if x &gt; 885 and x &lt; 1066 and y &gt; 17 and y &lt; 93 then
tfm.exec.setShaman(name)
end
end

The x = tfm.get.room.playerList[name].x gets the player's x axis coordinates for the variable x and the y = tfm.get.room.playerList[name].y gets the player's y axis coordinates for the variable y. Therefore, in the next line (if x > 885 and x < 1066 and y > 17 and y < 93 then), since the variables x and y are checking for the player's coordinates, the system is checking if the player is in an x coordinate greater than 885 but less than 1066 and if the player is in a y coordinate greater than 17 but less than 93.

I'm not entirely sure if my theory is correct
Thedalek
« Citoyen »
1423497480000
    • Thedalek#0000
    • Profil
    • Derniers messages
#572
  0
Cool script made by Robonado:

Second Grade Equasion Solver a dit :
function result(func)
a,b,c= func:match("(%p*%d*)%a²(%p*%d*)%a*(%p*%d*)");
a,b,c= tonumber(a),tonumber(b),tonumber(c)
a,b,c= not a and 1 or a, not c and func:sub(-1):lower() ~= 'x' and 0 or b, not c and func:sub(-1):lower() == 'x' and 0 or not c and tonumber(func:match("²(%p*%d*)")) or c;
r= {(b*-1+math.sqrt(b^2-4*a*c))/(2*a), (b*-1-math.sqrt(b^2-4*a*c))/(2*a)};
return table.sort(r) or ('X = {%s}'):format(r[1] ~= r[1] and "" or r[1] ~= r[2] and table.concat(r, ", ") or r[1]);
end

print(result("x²-4x+4"))

Squirtlspkmn
« Citoyen »
1423546020000
    • Squirtlspkmn#0000
    • Profil
    • Derniers messages
    • Tribu
#573
  0
Juliantwofan a dit :
squirtlspkmn a dit :
1 more question, can u explain the x and y in this script

for name in pairs(tfm.get.room.playerList) do
x = tfm.get.room.playerList[name].x
y = tfm.get.room.playerList[name].y
if x &gt; 885 and x &lt; 1066 and y &gt; 17 and y &lt; 93 then
tfm.exec.setShaman(name)
end
end

The x = tfm.get.room.playerList[name].x gets the player's x axis coordinates for the variable x and the y = tfm.get.room.playerList[name].y gets the player's y axis coordinates for the variable y. Therefore, in the next line (if x &gt; 885 and x &lt; 1066 and y &gt; 17 and y &lt; 93 then), since the variables x and y are checking for the player's coordinates, the system is checking if the player is in an x coordinate greater than 885 but less than 1066 and if the player is in a y coordinate greater than 17 but less than 93.

I'm not entirely sure if my theory is correct

But why i make a script and it doesnt work in my x and y ._.
Velspar
« Citoyen »
1427902860000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#574
  0
Dont know if anyone has put anything like this here, myself and my tribe have a lot of fun with this though x)

Flood your tribe house. The water will rise until it reaches the top, then restart again.
The only downside for me, the water wont act like normal water...
SCRIPT a dit :
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
Whitesound
« Citoyen »
1434476700000
    • Whitesound#0220
    • Profil
    • Derniers messages
#575
  0
REZOLVED

Dernière modification le 1434551400000
Laagaadoo
« Citoyen »
1440703560000
    • Laagaadoo#0000
    • Profil
    • Derniers messages
    • Tribu
#576
  0
Colors a dit :

function color(text)
for c in text:gmatch("({[0-9a-fA-F]+})") do
text = text:gsub(c, "<font color='#"..c:sub(2,-2).."'>").."</font>"
end
return text
end

You can use this for coloring strings in containers like chat, popup, textarea, etc. Example:
a dit :
print(color("{ffff00}bananas {ffa500}oranges {ff0000}apples"))

will give you: http://i.imgur.com/CsbdBAM.png
Tricksymouse
« Citoyen »
1441267980000
    • Tricksymouse#0000
    • Profil
    • Derniers messages
    • Tribu
#577
  0
The snow script works out of tribe house for me
Velspar
« Citoyen »
1446160200000
    • Velspar#0000
    • Profil
    • Derniers messages
    • Tribu
#579
  0
Someone requested me to make this, it just makes players around you use whatever random emotes you set every interval of the set time.
What its already set to will make anyone within 100 pixels/orwhateverunit of me use the kiss emote every second.

a dit :
_NAME = "Velspar" -- Your name.

_TIME = 1 *1000 -- Amount of seconds * milliseconds. Dont change the *1000.

_RANGE = 100 -- Distance from player <_NAME>.

_EMOTES = {3} -- Emotes that will be performed by players around player <_NAME>.

--Dont need to edit anything else.

timestamp = os.time()+_TIME

function eventLoop(time, remaining)
local main = tfm.get.room.playerList[_NAME]

if os.time() > timestamp then
for name, player in pairs(tfm.get.room.playerList) do
if name ~= _NAME and math.sqrt(math.pow(player.x - main.x,2) + math.pow(player.y - main.y,2)) < _RANGE then
tfm.exec.playEmote(name, _EMOTES[math.random(#_EMOTES)])
end
end
timestamp = os.time()+_TIME
end
end

*I hope small scripts are also allowed in this thread.
Cryshalis
« Citoyen »
1447578060000
    • Cryshalis#0000
    • Profil
    • Derniers messages
    • Tribu
#580
  0
for name,player in pairs(tfm.get.room.playerList) do
system.bindMouse(name, true)
end

function eventMouse(name, x, y)
tfm.exec.addShamanObject(tfm.enum.shamanObject.littleBox, x, y, 0, 0, 0, false)
end

-- tfm.enums: http://kikoo.formice.com/doku.php?id=module_api_documentation#tfmenumshamanobject_package
-- exact enums: http://kikoo.formice.com/doku.php?id=enums#objects_anchor
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 29 / 33 › »
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27