×

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
1 / 4 › »
[Script] Lightning
Finalnova
« Citoyen »
1398868320000
    • Finalnova#0095
    • Profil
    • Derniers messages
#1
  0
Teleport and lightning will follow bzbzbzbzzzzzzzzzpew

just change username with your username.

Pastebin: http://pastebin.com/PUUy3wei

Finalnova a dit :

username = "Finalnova"

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
tfm.exec.newGame(0)
tfm.exec.disableAutoNewGame(true)


Dogangun
« Citoyen »
1398868860000
    • Dogangun#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Good. :)
Jordy
« Consul »
1398877800000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Hey Finalnova, I tried your script but you forgot to close the radToDeg(i) function and there is an error when I try to teleport.

a dit :
## Runtime Error : Jordynl.lua:19: attempt to call nil

Other then that. Looks good!

Edit: I thought that they fixed that... Thanks Leafileaf, Shamousey and Fxie for telling me.
Shamousey
« Consul »
1398877920000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Jordy, there's a bug with these forums that when staff posts a < character, everything after isn't displayed. The PasteBin version works fine.
Leafileaf
« Citoyen »
1398878040000
    • Leafileaf#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Shamousey a dit :
Jordy, there's a bug with these forums that when staff posts a < character, everything after isn't displayed. The PasteBin version works fine.

Edit: Not *really* a bug. Intended feature so staff can make <B> tags and stuff. And of course it reacts in the same way as tfm, where it breaks your chat. All the text afterwards is treated as part of the tag and doesn't display.
Fxie
« Citoyen »
1398878160000
    • Fxie#0000
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Leafileaf a dit :


Not a bug. Intended feature so staff can make &amp;lt;B&amp;gt; and stuff. And of course it reacts in the same way as tfm, where it breaks your chat. All the text afterwards is treated as part of the tag and doesn't display.

it is a bug, they should have escaped it with &lt;

might as well just linkify the pastebin link, nobody can copy anything on these forums anyway
Zutto
« Citoyen »
1398897000000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#7
  1
Pro script.

But the line 19; drawLightining(p.x,p.y,x,y,randomId()), that calls drawLightining function and there isn't any function with that name

I wrote drawLine and now works :D

Thanks you !
Loremg
« Citoyen »
1398899280000
    • Loremg#0000
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Ty! :)
Urimg
« Citoyen »
1398899580000
    • Urimg#0000
    • Profil
    • Derniers messages
    • Tribu
#9
  0
OMG! :'D
Shamousey
« Consul »
1398901500000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#10
  0
Aritxy a dit :
But the line 19; drawLightining(p.x,p.y,x,y,randomId()), that calls drawLightining function and there isn't any function with that name!

drawLightining() is on line 84.
Benbirkralm
« Citoyen »
1398929880000
    • Benbirkralm#0000
    • Profil
    • Derniers messages
    • Tribu
#11
  0
It's crashing, when the eventMouse'll be 40 ms.
But good script.
Cagataymylov
« Censeur »
1398943860000
    • Cagataymylov#0000
    • Profil
    • Derniers messages
    • Tribu
#12
  0
Nice one~ ;3
Manacer
« Citoyen »
1398943860000
    • Manacer#0000
    • Profil
    • Derniers messages
    • Tribu
#13
  0
Ow, so good
Plastoy
« Citoyen »
1398943860000
    • Plastoy#0000
    • Profil
    • Derniers messages
#14
  0
Good ! :)

That's nice.
Zutto
« Citoyen »
1398961020000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Shamousey a dit :


drawLightining() is on line 84.

First I saw only the scirpt of the forum :(

Fixed with pastebin
Lelebize
« Citoyen »
1398983040000
    • Lelebize#0000
    • Profil
    • Derniers messages
#16
  0
How to set all players to teleport with particles?
Zutto
« Citoyen »
1398985440000
    • Zutto#4451
    • Profil
    • Derniers messages
    • Tribu
#17
  0
Lelebize a dit :
How to set all players to teleport with particles?

Done ^^

http://pastebin.com/FyBdEzst

But remember!
Runtime can't exceed 40 ms in 4 seconds !
Lelebize
« Citoyen »
1399036620000
    • Lelebize#0000
    • Profil
    • Derniers messages
#18
  0
Thank you :3
but no way I can put this radius to the players that I want to sort my friends only they can use?
Mouldychesse
« Citoyen »
1399043820000
    • Mouldychesse#0000
    • Profil
    • Derniers messages
    • Tribu
#19
  0
Cool!

http://i.imgur.com/48gIvJP.png
Can you add two people's name?
Cagataymylov
« Censeur »
1399044060000
    • Cagataymylov#0000
    • Profil
    • Derniers messages
    • Tribu
#20
  0
Mouldychesse a dit :
Cool!

Can you add two people's name?

thats what i wanted^^
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] Lightning
1 / 4 › »
© Atelier801 2018

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

Version 1.27