×

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
« ‹ 23 / 33 › »
Lua Snippets
Hakureimouse
« Citoyen »
1381274460000
    • Hakureimouse#0000
    • Profil
    • Derniers messages
    • Tribu
#441
  0
Bengalstar a dit :
how can I make a popup only pop up for people who haven't viewed it already?
like at the start of a new round?
--
here's what I did (pls i have newbie skills at this)

function eventNewPlayer(name)
if player==true then
ui.addPopup(not going to copy and paste what this says)

it won't work though

I think this should go in the Script Requests thread: Topic-462959 but anyway:

At the start of the script:
Lua a dit :
local mouse = {}

function eventNewPlayer (player)
mouse[player] = {viewedPopup = false}
end

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

Now, let's say you want to show a Popup at the start of a new round, just like you said:
Lua a dit :
function eventNewGame()
for name in pairs(tfm.get.room.playerList) do
if not mouse[name].viewedPopup then
ui.addPopup (0, 0, "meow", name, 350, 200, 100)
mouse[name].viewedPopup = true
end
end
end

.
Bengalstar
« Citoyen »
1381274460000
    • Bengalstar#0000
    • Profil
    • Derniers messages
#442
  0
Hakureimouse a dit :
I think this should go in the Script Requests thread: Topic-462959 but anyway:

oh ok thanks
I get confused between those two threads sorry vwv
Hakureimouse
« Citoyen »
1381275360000
    • Hakureimouse#0000
    • Profil
    • Derniers messages
    • Tribu
#443
  0
Bengalstar a dit :
oh ok thanks
I get confused between those two threads sorry vwv

It's ok :x
==
https://paste.moepl.eu/view/e86b0387
I made two simple functions to create scrolling texts.

It's quite easy to use, just create a new scrolling text object with scrollingText.new(String text, Integer lenght) where lenght is the ammount of characters you want to show on screen, and save it to a variable.

Then each time you want to refresh, or 'move' the text, just call scrollingText.next (table scrollingText), where scrollingText is the variable with the object you just created.

Example:

Lua a dit :
local text = scrollingText.new ("Here goes your text", 6)

function eventLoop (a,b)
ui.setUIShamanName (scrollingText.next(text))
end

I hope you guys find this useful somehow :)
Bengalstar
« Citoyen »
1381275480000
    • Bengalstar#0000
    • Profil
    • Derniers messages
#444
  0
function eventchatCommand(name)
if command=="tutorial then
ui.addTextArea(0, player.. " has requested a tutorial! Grab onto a balloon and press the sit emotion to spawn runes. Type in !help for more information.")
end
end
--
[•] Init Error : [string "transformice.lua"]:18: unfinished string
??
--
e: forgot the " at the end of tutorial nvm
Xanmeow
« Citoyen »
1381282380000
    • Xanmeow#0000
    • Profil
    • Derniers messages
    • Tribu
#445
  0
Lua a dit :
local text = scrollingText.new ("Here goes your text", 6)

function eventLoop (a,b)
ui.setUIShamanName (scrollingText.next(text))
end



doesnt work
Shamousey
« Consul »
1381282800000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#446
  0
Xanmeow a dit :
doesnt work

It does work, you have to use the rest of the code he posted too though.
Wizardsofdra
« Citoyen »
1381283580000
    • Wizardsofdra#0000
    • Profil
    • Derniers messages
#447
  0
Shamousey a dit :
It does work, you have to use the rest of the code he posted too though.

can any of you post the full code in pastebin or something?
Jordy
« Consul »
1381284300000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#448
  0
Wizardsofdra a dit :
can any of you post the full code in pastebin or something?

https://paste.moepl.eu/view/e86b0387?
Safwanrockz
« Censeur »
1381342680000
    • Safwanrockz#0095
    • Profil
    • Derniers messages
    • Tribu
#449
  0
Amazing lua codes, well done jack~
Shamousey
« Consul »
1381372920000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#450
  0
Here's a simple team maker.

a dit :
red={}
blue={}
function makeTeams()
local playerList={}
for name,player in pairs(tfm.get.room.playerList) do
table.insert(playerList,name)
end
for i=1,#playerList,1 do
local index=math.random(#playerList)
local name=playerList[index]
if i%2==0 then
table.insert(red,name)
else
table.insert(blue,name)
end
table.remove(playerList,index)
end
end

 
Funkieee
« Citoyen »
1381381740000
    • Funkieee#0000
    • Profil
    • Derniers messages
    • Tribu
#451
  0
It's posible to spawn particles? How?
Mikuhl
« Citoyen »
1381433820000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#452
  0
Funkieee a dit :
It's posible to spawn particles? How?

Not possible yet.
Bengalstar
« Citoyen »
1381444440000
    • Bengalstar#0000
    • Profil
    • Derniers messages
#453
  0
umm I need help with this

function eventKeyboard(playerName, 48, false, 0, 0)
if i==48 then
tfm.exec.addShamanObject(40, tfm.get.room.playerList[playerName].x, tfm.get.room.playerList[playerName].y, 0, 0, 0, true)
end
end
--
something is wrong ;;
[•] Init Error : [string "transformice.lua"]:108: or '...' expected
also line 108 is the start of the function
Unimeowse
« Citoyen »
1381445220000
    • Unimeowse#0000
    • Profil
    • Derniers messages
    • Tribu
#454
  0
I'm trying to get the sun fur on people in the room with the tfm.get.room.playerList[name].look code. Somehow I can't get it to work x.x
Mikuhl
« Citoyen »
1381446480000
    • Mikuhl#3311
    • Profil
    • Derniers messages
    • Tribu
#455
  0
Unimeowse a dit :
I'm trying to get the sun fur on people in the room with the tfm.get.room.playerList[name].look code. Somehow I can't get it to work x.x

You cant change peoples outfits and you never will be able to according to tig.

Bengalstar a dit :

function eventKeyboard(playerName, 48, false, 0, 0)

You didnt define what i was, you could do
a dit :

function eventKeyboard(playerName, i)
Beachking
« Citoyen »
1381581180000
    • Beachking#0000
    • Profil
    • Derniers messages
    • Tribu
#456
  0
I thought I'd put this here if anyone wants to use it or not.

• You can change the setUiMapName color using your own colours instead of ''<N>'' You can make it bolder change the size of it and even clear the whole map bar and just leave the mapName.

• tfm.exec.setUIMapName("<font color='#COLOR'><b>TEXT</b></font>\n")

<font color='#COLOR'></font> - Is used to add a color of your choice.

<b></b> Is making the text bold

\n Creates a new line so it would clear anything that comes fter the mapname.

There are others like size and italics. Just use HTML tags.

When using \n the other bar is viable if you hgihlight the map name and drag across.
Shamousey
« Consul »
1381586280000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#457
  0
Alternatively to what Beachking said, you can just print a < character in the bar and everything after it won't display. Useful if you want to make your own entire top bar.
Shamousey
« Consul »
1381595880000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#459
  0
a dit :
function eventSummoningEnd(name,objectType,x,y,angle,xSpeed,ySpeed,other)
tfm.exec.removeObject(other.id)
end

 
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Lua Snippets
« ‹ 23 / 33 › »
© Atelier801 2018

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

Version 1.27