×

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] Lightning
« ‹ 3 / 4 › »
[Script] Lightning
Shamousey
« Consul »
1411135680000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#41
  0
Dreamingmous a dit :
Dreamingmous = "Finalnova"

You got this the wrong way round, it has to be:

username = "Dreamingmous"
Xenpai
« Citoyen »
1411837200000
    • Xenpai#9332
    • Profil
    • Derniers messages
    • Tribu
#42
  0
I still love this hah
Dreamingmous
« Citoyen »
1411998180000
    • Dreamingmous#0000
    • Profil
    • Derniers messages
    • Tribu
#43
  0
Shamousey a dit :
Dreamingmous a dit :
Dreamingmous = "Finalnova"

You got this the wrong way round, it has to be:

username = "Dreamingmous"

Oh thanks, LOL!
Moshimoshiz
« Citoyen »
1412112420000
    • Moshimoshiz#0000
    • Profil
    • Derniers messages
    • Tribu
#44
  0
Ill try it. I hope it works..
Olliethekit
« Citoyen »
1412113200000
    • Olliethekit#0000
    • Profil
    • Derniers messages
#45
  0
I put in the script, in the lua, (change the username), and the map changed, I was shaman, I started clicking things, teleporting, and stuff, nothing happened.. I have my particle effects on.

Edit: The map also changes back to the tribehouse after only a couple of seconds. I'd say around 5 seconds.

Dernière modification le 1412113380000
Wecwec
« Citoyen »
1412125140000
    • Wecwec#0000
    • Profil
    • Derniers messages
    • Tribu
#46
  0
olliethekit a dit :
I put in the script, in the lua, (change the username), and the map changed, I was shaman, I started clicking things, teleporting, and stuff, nothing happened.. I have my particle effects on.

Edit: The map also changes back to the tribehouse after only a couple of seconds. I'd say around 5 seconds.

To avoid changing the map/refreshing the map every time you play it remove the

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

from the end of the script. Not sure why your not seeing the particles though, if they're on.
Olliethekit
« Citoyen »
1412159880000
    • Olliethekit#0000
    • Profil
    • Derniers messages
#47
  0
Wecwec a dit :
olliethekit a dit :
I put in the script, in the lua, (change the username), and the map changed, I was shaman, I started clicking things, teleporting, and stuff, nothing happened.. I have my particle effects on.

Edit: The map also changes back to the tribehouse after only a couple of seconds. I'd say around 5 seconds.

To avoid changing the map/refreshing the map every time you play it remove the

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

from the end of the script. Not sure why your not seeing the particles though, if they're on.

Although, I read other comments, and I did what this person said, to remove
tfm.exec.newGame(0)
tfm.exec.disableAutoNewGame(true)

So I tried it without that, still didn't work... I've never been able to really lua... Too confusing.

Dernière modification le 1412159940000
Hpocks
« Citoyen »
1412430360000
    • Hpocks#0000
    • Profil
    • Derniers messages
    • Tribu
#48
  0
What rooms can I put this in? Did it in my tribe house and got whatver this is

Runtime Error : Hpocks.lua:59: attempt to perform arithmetic __sub on nil and number

Dernière modification le 1412430540000
Moshimoshiz
« Citoyen »
1412437020000
    • Moshimoshiz#0000
    • Profil
    • Derniers messages
    • Tribu
#49
  0
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] tfm.exec.bindKeyboard : argument 1 can't be NIL.
[Lua] # [*Platinum cheese collecting team] '

It spammed me D:
Umbrasnow
« Citoyen »
1413128880000
    • Umbrasnow#0000
    • Profil
    • Derniers messages
#50
  0
It seems to be working for everyone else but me. I'm not sure what exactly it's going wrong, I entered this code.


username = "umbrasnow"

for i=0,200 do
tfm.exec.bindKeyboard(username,i,true,true)
end

system.bindMouse(username,true)

function randomId()

local idHolder = {0,1,9}
return idHolder[math.random(0,#idHolder)]

end

function eventMouse(n,x,y)

local p = tfm.get.room.playerList[n]
drawLightining(p.x,p.y,x,y,randomId())
drawLightining(p.x,p.y,x,y,randomId())
drawLightining(p.x,p.y,x,y,randomId())
tfm.exec.movePlayer(n,x,y)

end

function eventKeyboard(n,k,d,x,y)

local p = tfm.get.room.playerList[n]
p.x = x
p.y = y

end

move = 3
ms = move/20
ma = ms/1200

function drawLine(x1,y1,x2,y2,spaces,id)

id = id or 9
spaces = spaces or 3


local distance = getDistance(x1,y1,x2,y2)
local numOfParticles = math.floor(distance/spaces)
local angle = getAngle(x1,y1,x2,y2)
for i=0,numOfParticles do

local dotX = x1+math.cos(angle)*(i*spaces)
local dotY = y1+math.sin(angle)*(i*spaces)
tfm.exec.displayParticle(id,dotX,dotY,math.random()*ms-ms/2,math.random()*ms-ms/2,math.random()*ma-ma/2,math.random()*ma-ma/2)

end

end

function getDistance(x1,y1,x2,y2)

return math.sqrt(math.abs(x1-x2)^2+math.abs(y1-y2)^2)

end

function getAngle(x1,y1,x2,y2)

return math.atan2(y2-y1,x2-x1)

end

function radToDeg(i)

i = i*180/math.pi
i = i<0 and i+360 or i
return i

end

function degToRad(i)

return i*math.pi/180

end


function drawLightining(x1,y1,x2,y2,id)

local ang = getAngle(x1,y1,x2,y2)
local dis = getDistance(x1,y1,x2,y2)
local rd = function() return math.random()*25+25 end
local ra = function() return math.pi/(math.random()*120+30) end
local wave = {}
local addWave = function(k,xx,yy) wave[k] = {x=xx,y=yy} end

--------------------------------------

addWave(0,x1,y1)
local td = 0
local randomDistance = rd()
local randomAngle = ra()*((dis-td)/100)
local zigZag = math.random()<0.5 and 1 or -1
local ca = ang + randomAngle*zigZag


while randomDistance<dis-td do

td = td + randomDistance

local tx = x1+math.cos(ca)*td
local ty = y1+math.sin(ca)*td

addWave(#wave+1,tx,ty)

randomDistance = rd()
randomAngle = ra()*((dis-td)/100)
zigZag = zigZag * -1
ca = ang + randomAngle*zigZag

end

addWave(#wave+1,x2,y2)

for i=0,#wave-1 do

local cw = wave
local nw = wave[i+1]
drawLine(cw.x,cw.y,nw.x,nw.y,3,id)

end


end


Dernière modification le 1413148260000
Shamousey
« Consul »
1413148320000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#51
  0
username = "umbrasnow"

The first character of your name needs to be a capital.

username = "Umbrasnow"
Tikuscherrys
« Citoyen »
1413208260000
    • Tikuscherrys#0000
    • Profil
    • Derniers messages
#52
  0
Thanks! i have trouble with the 5 second map change. i just change the
tfm.exec.newGame(0)
tfm.exec.disableAutoNewGame(true)

with
tfm.exec.newGame(0)
tfm.exec.disableAutoNewGame(false)

i don't know if it already said. (and i little off topic but how do you use spoiler?)

Dernière modification le 1413208320000
Crazysushi
« Citoyen »
1413245160000
    • Crazysushi#0000
    • Profil
    • Derniers messages
#53
  0
[Lua] # [*Widdle PocketMice] [Crazysushi] Lua script loaded in 2 ms (4000 max)
[Lua] # [*Widdle PocketMice] Runtime Error : Crazysushi.lua:59: attempt to perform arithmetic __sub on nil and number


o_o"" Ehh?
Backtobeback
« Citoyen »
1421005680000
    • Backtobeback#0000
    • Profil
    • Derniers messages
    • Tribu
#54
  0
Some1 please fix the 59 bug?
Honey_bee
« Citoyen »
1423890420000
    • Honey_bee#9272
    • Profil
    • Derniers messages
#55
  0
Whats the controls?
Fussbet
« Citoyen »
1424068140000
    • Fussbet#0000
    • Profil
    • Derniers messages
    • Tribu
#56
  0
thats funny thats the pic?
Zekabatu
« Citoyen »
1434303300000
    • Zekabatu#0000
    • Profil
    • Derniers messages
#57
  0
umbrasnow a dit :
It seems to be working for everyone else but me. I'm not sure what exactly it's going wrong, I entered this code.


username = "umbrasnow"

for i=0,200 do
tfm.exec.bindKeyboard(username,i,true,true)
end

system.bindMouse(username,true)

function randomId()

local idHolder = {0,1,9}
return idHolder[math.random(0,#idHolder)]

end

function eventMouse(n,x,y)

local p = tfm.get.room.playerList[n]
drawLightining(p.x,p.y,x,y,randomId())
drawLightining(p.x,p.y,x,y,randomId())
drawLightining(p.x,p.y,x,y,randomId())
tfm.exec.movePlayer(n,x,y)

end

function eventKeyboard(n,k,d,x,y)

local p = tfm.get.room.playerList[n]
p.x = x
p.y = y

end

move = 3
ms = move/20
ma = ms/1200

function drawLine(x1,y1,x2,y2,spaces,id)

id = id or 9
spaces = spaces or 3


local distance = getDistance(x1,y1,x2,y2)
local numOfParticles = math.floor(distance/spaces)
local angle = getAngle(x1,y1,x2,y2)
for i=0,numOfParticles do

local dotX = x1+math.cos(angle)*(i*spaces)
local dotY = y1+math.sin(angle)*(i*spaces)
tfm.exec.displayParticle(id,dotX,dotY,math.random()*ms-ms/2,math.random()*ms-ms/2,math.random()*ma-ma/2,math.random()*ma-ma/2)

end

end

function getDistance(x1,y1,x2,y2)

return math.sqrt(math.abs(x1-x2)^2+math.abs(y1-y2)^2)

end

function getAngle(x1,y1,x2,y2)

return math.atan2(y2-y1,x2-x1)

end

function radToDeg(i)

i = i*180/math.pi
i = i&lt;0 and i+360 or i
return i

end

function degToRad(i)

return i*math.pi/180

end


function drawLightining(x1,y1,x2,y2,id)

local ang = getAngle(x1,y1,x2,y2)
local dis = getDistance(x1,y1,x2,y2)
local rd = function() return math.random()*25+25 end
local ra = function() return math.pi/(math.random()*120+30) end
local wave = {}
local addWave = function(k,xx,yy) wave[k] = {x=xx,y=yy} end

--------------------------------------

addWave(0,x1,y1)
local td = 0
local randomDistance = rd()
local randomAngle = ra()*((dis-td)/100)
local zigZag = math.random()&lt;0.5 and 1 or -1
local ca = ang + randomAngle*zigZag


while randomDistance&lt;dis-td do

td = td + randomDistance

local tx = x1+math.cos(ca)*td
local ty = y1+math.sin(ca)*td

addWave(#wave+1,tx,ty)

randomDistance = rd()
randomAngle = ra()*((dis-td)/100)
zigZag = zigZag * -1
ca = ang + randomAngle*zigZag

end

addWave(#wave+1,x2,y2)

for i=0,#wave-1 do

local cw = wave
local nw = wave[i+1]
drawLine(cw.x,cw.y,nw.x,nw.y,3,id)

end


end


Runtime Error : org.luaj.vm2.LuaError: Zekabatu.lua:65: attempt to perform arithmetic __sub on nil and number
Matt
« Citoyen »
1434940500000
    • Matt#6915
    • Profil
    • Derniers messages
    • Tribu
#58
  0
working link
Backupjulian
« Citoyen »
1445817600000
    • Backupjulian#0000
    • Profil
    • Derniers messages
#59
  0
How does this work?
Mad
« Citoyen »
1455301620000
    • Mad#0878
    • Profil
    • Derniers messages
    • Tribu
#60
  0
• [19:27] # [*We are pro tribe] Runtime Error : org.luaj.vm2.LuaError: Madandras.lua:59: attempt to perform arithmetic __sub on nil and number

What is the problem?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Lightning
« ‹ 3 / 4 › »
© Atelier801 2018

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

Version 1.27