×

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
« ‹ 27 / 33 › »
Lua Snippets
Bad
« Citoyen »
1395679440000
    • Bad#9645
    • Profil
    • Derniers messages
    • Tribu
#521
  0
Safwanrockz a dit :

Use this (!respawn Name)
There are several solutions for this, the easiest way to do it is to only bind the keyboard to the specific user you want.
 

Thanks
Zidatu
1395681120000
    • Zidatu#0000
    • Profil
    • Derniers messages
#522
[Modéré par Muffun, raison : spam]
Magicdasha
« Citoyen »
1395929340000
    • Magicdasha#0000
    • Profil
    • Derniers messages
#523
  0
Good thread *-*
Makinit
« Citoyen »
1396517460000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#524
  0
Colour conversion functions:
a dit :
function rgb2int(r, g, b)
r, g, b = r%256, g%256, b%256
return r*65536 + g*256 + b
end

function int2rgb(i)
i = i%16777216
local r = math.floor(i/65536)
i = i%65536
local g = math.floor(i/256)
local b = i%256
return r, g, b
end

function rgb2hex(r, g, b)
return string.sub(string.format("00000%x", rgb2int(r, g, b)), -6, -1)
end

function hex2rgb(h)
return int2rgb(tonumber(h, 16))
end

function hsv2rgb(h, s, v)
local r, g, b
local i = math.floor(h * 6)
local f = h * 6 - i
local p = v * (1 - s)
local q = v * (1 - f * s)
local t = v * (1 - (1 - f) * s)
local switch = i % 6
if switch == 0 then
r = v g = t b = p
elseif switch == 1 then
r = q g = v b = p
elseif switch == 2 then
r = p g = v b = t
elseif switch == 3 then
r = p g = q b = v
elseif switch == 4 then
r = t g = p b = v
elseif switch == 5 then
r = v g = p b = q
end
return math.floor(r*255), math.floor(g*255), math.floor(b*255)
end

function rgb2hsv(r, g, b)
r, g, b = r%256, g%256, b%256
r, g, b = r/255, g/255, b/255
local max, min = math.max(r, g, b), math.min(r, g, b)
local h, s
local v = max
local d = max - min
s = max == 0 and 0 or d/max
if max == min then
h = 0
elseif max == r then
h = (g - b) / d + (g < b and 6 or 0)
elseif max == g then
h = (b - r) / d + 2
elseif max == b then
h = (r - g) / d + 4
end
h = h/6
return h, s, v
end
Cactusjack
« Citoyen »
1397839860000
    • Cactusjack#4408
    • Profil
    • Derniers messages
    • Tribu
#525
  0
Spawn instant objects :
a dit :

function eventSummoningStart(playerName, objectId, xPosition, yPosition, degree)
tfm.exec.addShamanObject(objectId, xPosition, yPosition, degree)
end

foooooo
Pokesire
« Citoyen »
1397861340000
    • Pokesire#0000
    • Profil
    • Derniers messages
    • Tribu
#526
  0
A script to make gravity 0
Cactusjack
« Citoyen »
1397915520000
    • Cactusjack#4408
    • Profil
    • Derniers messages
    • Tribu
#527
  0
Pokesire a dit :
A script to make gravity 0

You'll be better off asking over here Topic-462959
Epicsouris
« Citoyen »
1397937360000
    • Epicsouris#0000
    • Profil
    • Derniers messages
#528
  0
It is impossible to make gravity 0 but it is possible to make your mouse hover
Williamkang
1400516220000
    • Williamkang#0000
    • Profil
    • Derniers messages
#529
[Modéré par Icewolfbob, raison : If your script is making errors, you can post here for help: http://www.transformice.com/forum/?s=458983&p=0 ^^]
Epicsouris
« Citoyen »
1400534760000
    • Epicsouris#0000
    • Profil
    • Derniers messages
#530
  0
Because you probably didn't answer the first arguement
Safwanrockz
« Censeur »
1400608380000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#531
  0
Epicsouris a dit :
It is impossible to make gravity 0 but it is possible to make your mouse hover

It's not impossible.
a dit :

gravity = 0
function eventNewGame()
xml = tfm.get.room.xmlMapInfo.xml:gsub("<P ", "<P G=\"0,0\"")
end

tfm.exec.newGame()

function eventChatCommand(name,cmd)
if cmd=="load" then
tfm.exec.newGame(xml)
end
end

Type !load to reload any map with 0 gravity.
Grimrice
« Citoyen »
1401731820000
    • Grimrice#0000
    • Profil
    • Derniers messages
    • Tribu
#532
  0
Tweetis a dit :
Spawn instant objects :

foooooo

doesnt work
Jordy
« Consul »
1401738720000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#533
  0
I was bored so I made a little teleport script.
Just click a random mouse and you will switch places with the mouse.

http://pastebin.com/LvJzXX96
Hophipmice
« Citoyen »
1401738960000
    • Hophipmice#0000
    • Profil
    • Derniers messages
    • Tribu
#534
  0
Jordynl a dit :
I was bored so I made a little teleport script.
Just click a random mouse and you will switch places with the mouse.

http://pastebin.com/LvJzXX96

It's sick...

I killed Jordynl with it 1000 times.
Grinjr
« Citoyen »
1401829500000
    • Grinjr#0000
    • Profil
    • Derniers messages
    • Tribu
#535
  0
A few questions,

How would you go about making it so that if a button is held down it runs a script in a loop until you let go? I've used other methods for this but my methods do not work for TFM scripts.
Is it possible to make a shaman, not a shaman anymore and just an ordinary mouse without resetting the map?
and is there any way to keep a script loaded in a tribe house without anyone/any bot being in the tribe room keeping it loaded?
Shamousey
« Consul »
1401830220000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#536
  0
Grinjr a dit :
How would you go about making it so that if a button is held down it runs a script in a loop until you let go? I've used other methods for this but my methods do not work for TFM scripts.

holding=false
tfm.exec.bindKeyboard("Shamousey",32,true,true)
tfm.exec.bindKeyboard("Shamousey",32,false,true)

function eventKeyboard(name,key,down,x,y)
if key==32 then
if down then
holding=true
else
holding=false
end
end
end

function eventLoop(time,remaining)
if holding then
print("Hello.")
end
end

Grinjr a dit :
Is it possible to make a shaman, not a shaman anymore and just an ordinary mouse without resetting the map?
and is there any way to keep a script loaded in a tribe house without anyone/any bot being in the tribe room keeping it loaded?

No, neither of those things are possible unfortunately.
Grinjr
« Citoyen »
1401831540000
    • Grinjr#0000
    • Profil
    • Derniers messages
    • Tribu
#537
  0
Shamousey a dit :

No, neither of those things are possible unfortunately.

Thank you!

And dang, could be a good addition, although!
Esh
« Censeur »
1401912660000
    • Esh#0095
    • Profil
    • Derniers messages
    • Tribu
#538
  0
Draw a circle using particles:
a dit :
function drawCircle(posX,posY,range)
local x, y, r = posX,posY, range
for i = 1, 360 do
local angle = i * math.pi / 180
local ptx, pty = x + r * math.cos( angle ), y + r * math.sin( angle )
tfm.exec.displayParticle(9, ptx, pty, 0, 0, 0, 0)
end
end
drawCircle(400,200,100)
Lutfihady
« Citoyen »
1401945060000
    • Lutfihady#0000
    • Profil
    • Derniers messages
    • Tribu
#539
  0
how to make it into something like img rats or dogs?
Leafileaf
« Citoyen »
1401950580000
    • Leafileaf#0000
    • Profil
    • Derniers messages
    • Tribu
#540
  0
Lutfihady a dit :
how to make it into something like img rats or dogs?

You'll need addImage which is not available in tribe houses.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 27 / 33 › »
© Atelier801 2018

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

Version 1.27