×

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
  • /
  • Script Requests
« ‹ 22 / 160 › »
Script Requests
Aanguson
« Citoyen »
1383477720000
    • Aanguson#8461
    • Profil
    • Derniers messages
#421
  0
Hophipmice a dit :
So, you want a script that would make people drop who press the down key?
If yes, then:

Thanks =D
Abdeltif
« Citoyen »
1383477720000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#422
  0
a dit :
x = {5, 6, 80, 40, 100, 96, 140, 132, 175, 150, 200, 215, 264, 320, 340, 390, 400}

tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame(0)

function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end


function eventLoop()
for i=5,6.2 do
tfm.exec.addShamanObject(1, x[math.random(#x)], 2)
tfm.exec.addShamanObject(20, 400, 300)
end
end

How can i make a configur the delay between every spawn please ?
Abdeltif
1383479280000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#423
[Modéré par Bolinboy, raison : double post]
Bushmeister
« Consul »
1383486540000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#424
  0
s a dit :
function eventLoop(ct,cr)
if tfm.get.room.currentMap=="@4462194" then
for namep, player in pairs(tfm.get.room.playerList) do
if not tfm.get.room.playerList[name].isShaman then
x=tfm.get.room.playerList[name].x
y=tfm.get.room.playerList[name].y
if (x>370 and x<390 and y>127 and y<140) then
print ("q")
end
end
end
end
end

[17:44] [•] Runtime Error : transformice.lua:4: attempt to index ? (a nil value)
What is wrong?
Abdeltif
« Citoyen »
1383486720000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#425
  0
Bushmeister a dit :
[17:44] [•] Runtime Error : transformice.lua:4: attempt to index ? (a nil value)
What is wrong?

for namep, player in pairs(tfm.get.room.playerList) do


Make it name not namep
that's why it don't read as [name] .
Kmlcan
« Citoyen »
1383487320000
    • Kmlcan#0000
    • Profil
    • Derniers messages
    • Tribu
#426
  0
How can I print a table like "element1, element2, ..." intead of
"element1
element2
..."?
Mikuhl
« Citoyen »
1383487440000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#427
  0
Kmlcan a dit :
How can I print a table like "element1, element2, ..." intead of
"element1
element2
..."?

table.concat(table, ", ")
Issey
« Citoyen »
1383489240000
    • Issey#0000
    • Profil
    • Derniers messages
#428
  0
Abdeltif a dit :
How can i make a configur the delay between every spawn please ?

a dit :
x = {5, 6, 80, 40, 100, 96, 140, 132, 175, 150, 200, 215, 264, 320, 340, 390, 400}
time=0

tfm.exec.disableAutoNewGame(true)
tfm.exec.newGame(0)

function eventPlayerDied(name)
tfm.exec.respawnPlayer(name)
end


function eventLoop()
if time<5 do
time=time+1
else
tfm.exec.addShamanObject(1, x[math.random(#x)], 2)
tfm.exec.addShamanObject(20, 400, 300)
time=0
end
end

bloop
edit:edited
Safwanrockz
« Censeur »
1383491820000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#429
  0
Bushmeister a dit :
[17:44] [•] Runtime Error : transformice.lua:4: attempt to index ? (a nil value)
What is wrong?

That code's working properly for me though.
Abdeltif
« Citoyen »
1383492180000
    • Abdeltif#0000
    • Profil
    • Derniers messages
    • Tribu
#430
  0
Issey a dit :
bloop

end ( to close while line 32)

after adding end at the end of the script
end ( to close while line 32)
Issey
« Citoyen »
1383499620000
    • Issey#0000
    • Profil
    • Derniers messages
#431
  0
So I have a string
a dit :
str="a ' b|b|c|d"

and I want to split the string by the | character
and idk how to so help
Shamousey
« Consul »
1383500760000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#432
  0
Issey a dit :
So I have a string

and I want to split the string by the | character
and idk how to so help

str="a ' b|b|c|d"

for split in string.gmatch(str, "[^%|]+") do
print(split)
end
Bushmeister
« Consul »
1383501780000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#433
  0
It's possible to use tfm.exec.removeimage() only for selected player (that is, if i=1 then tfm.exec.removeImage(id,playername)?
Mousechris
« Censeur »
1383504600000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#434
  0
Nvm this I figured it out
Zyx
« Censeur »
1383504600000
    • Zyx#8690
    • Profil
    • Derniers messages
#435
  0
Able to transform into a shaman object
Shamousey
« Consul »
1383504840000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#436
  0
Bushmeister a dit :
It's possible to use tfm.exec.removeimage() only for selected player (that is, if i=1 then tfm.exec.removeImage(id,playername)?

No, they can't be used on a specific player.

Swirlfire a dit :
Able to transform into a shaman object

#Iced does that, you can look into its code. Topic-484461
Fuzzfire
« Citoyen »
1383507960000
    • Fuzzfire#0000
    • Profil
    • Derniers messages
    • Tribu
#437
  0
When someone dances, they fall through grounds(I am thinking of impossible ones ;n;)
Guilherme
« Citoyen »
1383518040000
    • Guilherme#0368
    • Profil
    • Derniers messages
    • Tribu
#438
  0
script a dit :
function eventKeyboard(name, key, down, xPos, yPos)
if key == 32 then
local me = tfm.get.room.playerList[name]
for name,player in pairs(tfm.get.room.playerList) do
local victim = tfm.get.room.playerList[name]
if me.isShaman == true and victim ~= me then
if pythag(me.x, me.y, 20, victim.x, victim.y, 20) == true then
tfm.exec.killPlayer(victim.playerName)
tfm.exec.addShamanObject(tfm.enum.shamanObject.iceCube,victim.x,victim.y)
end
end
end
end
end

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

function eventNewGame()
players = {}
for name,player in pairs(tfm.get.room.playerList) do
eventNewPlayer(name)
end
end

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

main()

function eventChatCommand(name, message)
if message == "sh" then
tfm.exec.setShaman(name)
end
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

As you can see in my script, a part is ready ...
I needed you to do with the shaman could only freeze the mice if the mice had at a distance close to him, and he froze only one at a time.
And not that crash.
Sandermr
« Citoyen »
1383522420000
    • Sandermr#0000
    • Profil
    • Derniers messages
    • Tribu
#439
  0
nvm found out
Bushmeister
« Consul »
1383550080000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#440
  0
ko a dit :
function eventChatCommand(playerName, message)
if message=="stop" then
tfm.exec.disableAutoTimeLeft(true)
elseif message=="start" then
tfm.exec.disableAutoTimeLeft(false)
end
end

koko a dit :
tfm.exec.disableAutoTimeLeft(true)

Not worked... why?
upd:
q a dit :

tfm.exec.addImage(String imageName, String target, Int xPosition, Int yPosition)
• Add an image to the map. Target can be :
!foregroundLayerDepth
Return an image id.

If i set tfm.exec.addImage(imageName, !1, 400, 200) then image with id will be at forerground?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 22 / 160 › »
© Atelier801 2018

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

Version 1.27