×

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
« ‹ 129 / 160 › »
Script Requests
Onkei
« Citoyen »
1494064620000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2561
  0
Msluvattack a dit :
i, don't know how too do the lua stuff ,i just wanna make npcs. why is it so complicated. =3=

What do you want the NPCs to say / do?
Xinaug
« Citoyen »
1494416520000
    • Xinaug#0000
    • Profil
    • Derniers messages
    • Tribu
#2563
  0
Sorry if this is the wrong place to say this but:

i kind of feel that someone here has the skill to make a mafia/werewolf/town of salem module ; p
Noonicknames
« Citoyen »
1494754020000
    • Noonicknames#0000
    • Profil
    • Derniers messages
    • Tribu
#2564
  0
Answer these:

edit 1. How do I make textarea to only display if when that person triggers it without everyone seeing it.

2. How do i make the person who entered the lua script the admin

3. How do i make something spawn at a different angle if the mouse is facing a different direction

4. Can you show me how i can kill a mouse with space but u have to be standing 5 pixels away or less if you are the killer.

Dernière modification le 1494762600000
Athesdrake
« Citoyen »
1494754680000
    • Athesdrake#0000
    • Profil
    • Derniers messages
    • Tribu
#2565
  0
Noonicknames a dit :
Answer these:

1. How do I make something to only display if when that person triggers it without everyone seeing it.

2. How do i make the person who entered the lua script the admin

3. How do i make something spawn at a different angle if the mouse is facing a different direction

1. It depends what's you want to show.

2. You can't do that. The person has to enter his nickname directly in the script.
Code Lua

1
admin = "ADMIN" --Change ADMIN by your pseudo

3.
Code Lua

1
2
name = "Noonicknames"
tfm.exec.addShamanObject(19, 400, 200, tfm.get.room.playerList[name].isFacingRight and 0 or 180)
Loghorizonph
« Citoyen »
1494831660000
    • Loghorizonph#0000
    • Profil
    • Derniers messages
    • Tribu
#2566
  0
Anyone can add Respawn in shop in this code
-- AirMatch v1.1b
-- Credits: Mawcn

admin = "Mawcn" -- you can put ur nick here
cash = {}
countdown = 6
item = {}
maps = {7009353, 7009355}
players = {}

tfm.exec.disableAutoNewGame()
tfm.exec.disableAutoShaman()

tfm.exec.newGame(maps[math.random(#maps)])

function eventNewGame()
countdown = 6
started = false
tfm.exec.setUIMapName("<J>"..countdown.."...\n")
end

function eventNewPlayer(pN)
item[pN] = 0
players[pN] = {timestamp = os.time()}
tfm.exec.bindKeyboard(pN, 32, true, true)
for n, kC in pairs({40}) do
tfm.exec.bindKeyboard(pN, kC, true, true)
end
system.bindMouse(pN, true)
if pN == admin then
cash[pN] = 888888
else
cash[pN] = 0
end
ui.addTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
ui.addTextArea(1, "<a href = 'event:derollshop'>Shop! ▼", pN, 9, 28, 100, 20, 0x111111, 0x111111, 1, true)
end

function eventLoop(eT, rT)
if eT >= 6000 and not started then
started = true
end
countdown = countdown - 1
tfm.exec.setUIMapName("<J>"..countdown.."...\n")
if countdown <= 0 then
tfm.exec.setUIMapName("<J>Fight!\n")
end
for pN in pairs(tfm.get.room.playerList) do
cash[pN] = cash[pN] + 1
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
end

function eventKeyboard(pN, kC, down, x, y)
if kC == 32 then
tfm.exec.movePlayer(pN, 0, 0, true, 0, -50, false)
elseif kC == 40 and item[pN] == 0 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(17, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
elseif kC == 40 and item[pN] == 1 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(1701, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
elseif kC == 40 and item[pN] == 2 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(1703, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
elseif kC == 40 and item[pN] == 3 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(1702, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
elseif kC == 40 and item[pN] == 4 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(1704, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
elseif kC == 40 and item[pN] == 5 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(1705, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
elseif kC == 40 and item[pN] == 6 and players[pN].timestamp < os.time() - 750 then
tfm.exec.addShamanObject(1706, x, y, tfm.get.room.playerList[pN].isFacingRight and 90 or 270)
players[pN].timestamp = os.time()
end
end

function eventPlayerDied(pN)
local aM = 0
local pN2
for n, p in pairs(tfm.get.room.playerList) do
if not p.isDead then
aM = aM + 1
pN2 = n
end
end
if aM == 1 then
tfm.exec.giveCheese(pN2)
tfm.exec.playerVictory(pN2)
tfm.exec.setGameTime(5)
tfm.exec.newGame(maps[math.random(#maps)])
end
end

function eventTextAreaCallback(id, pN, answer)
if answer == "derollshop" then
ui.addTextArea(1, "<a href = 'event:rollshop'>Shop! ▲</a>\n-> <a href = 'event:glassed'>Glassed cannon - 250 coins</a>\n-> <a href = 'event:ornament'>Ornament cannon - 250 coins</a>\n-> <a href = 'event:lollipop'>Lollipop cannon - 300 coins</a>\n-> <a href = 'event:angel'>Angel cannon - 350 coins</a>\n-> <a href = 'event:apple'>Apple cannon - 350 coins</a>\n-> <a href = 'event:watermelon'>Watermelon cannon - 500 coins</a>", pN, 9, 27, 205, 100, 0x111111, 0x111111, 1, true)
elseif answer == "rollshop" then
ui.addTextArea(1, "<a href = 'event:derollshop'>Shop! ▼", pN, 9, 28, 100, 20, 0x111111, 0x111111, 1, true)
elseif answer == "glassed" then
if cash[pN] >= 250 then
item[pN] = 1
cash[pN] = cash[pN] - 250
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
elseif answer == "ornament" then
if cash[pN] >= 250 then
item[pN] = 2
cash[pN] = cash[pN] - 250
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
elseif answer == "lollipop" then
if cash[pN] >= 300 then
item[pN] = 3
cash[pN] = cash[pN] - 300
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
elseif answer == "angel" then
if cash[pN] >= 350 then
item[pN] = 4
cash[pN] = cash[pN] - 350
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
elseif answer == "apple" then
if cash[pN] >= 350 then
item[pN] = 5
cash[pN] = cash[pN] - 350
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
elseif answer == "watermelon" then
if cash[pN] >= 500 then
item[pN] = 6
cash[pN] = cash[pN] - 500
ui.updateTextArea(0, "You have "..cash[pN].." cash!", pN, 638, 28, 155, 20, 0x111111, 0x111111, 1, true)
end
end
end

for pN in pairs(tfm.get.room.playerList) do
eventNewPlayer(pN)
end
Nox
« Citoyen »
1495391040000
    • Nox#2215
    • Profil
    • Derniers messages
    • Tribu
#2567
  0
I'm trying to figure out how to remove a text area at a certain time. The timer is counting up so when it gets to 15 seconds it pops up, I want it to disappear at 18 seconds.
Onkei
« Citoyen »
1495396980000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2568
  0
Bradmouser a dit :
I'm trying to figure out how to remove a text area at a certain time. The timer is counting up so when it gets to 15 seconds it pops up, I want it to disappear at 18 seconds.


Code Lua

1
2
3
4
5
6
7
8
9
function eventLoop(passed, left)
if passed >= 18000 then
-- The ID (0 in this case) should be the same as the textArea below.
ui.removeTextArea(0, nil)
elseif passed >= 15000 then
-- Insert your textArea here
ui.addTextArea(0, "Some Text Here", nil, 350, 150, nil, nil, 0x324650, 0x000000, 1, true)
end
end

Dernière modification le 1495397160000
Nox
« Citoyen »
1495401240000
    • Nox#2215
    • Profil
    • Derniers messages
    • Tribu
#2569
  0
Onkei a dit :
Bradmouser a dit :
I'm trying to figure out how to remove a text area at a certain time. The timer is counting up so when it gets to 15 seconds it pops up, I want it to disappear at 18 seconds.


Code Lua

1
2
3
4
5
6
7
8
9
function eventLoop(passed, left)
if passed >= 18000 then
-- The ID (0 in this case) should be the same as the textArea below.
ui.removeTextArea(0, nil)
elseif passed >= 15000 then
-- Insert your textArea here
ui.addTextArea(0, "Some Text Here", nil, 350, 150, nil, nil, 0x324650, 0x000000, 1, true)
end
end

What if there's already an eventLoop?
Onkei
« Citoyen »
1495406040000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2570
  0
Bradmouser a dit :
What if there's already an eventLoop?

You put the inside code from the eventLoop I gave you to the original one you have. Having two events / functions will overwrite each other.
Turce1st
« Censeur »
1495723500000
    • Turce1st#4618
    • Profil
    • Derniers messages
#2571
  0
Hello
i need help in edit my script
i want add
king of blue team
king of red team
and i want add skills for the kings
tfm.exec.disableAutoShaman(true)
tfm.exec.newGame(7154149)
tfm.exec.disableAfkDeath(false)
local red = {}
local blue = {}
local mice = {}
local range = 50

function eventNewGame()
local playerList={}
for playerName,player in pairs(tfm.get.room.playerList) do
table.insert(playerList,playerName)
end

for i=1,#playerList,1 do
local index=math.random(#playerList)
local playerName=playerList[index]
if i%2==0 then
table.insert(red,playerName)
tfm.exec.setNameColor(playerName, 0xDE2929)
tfm.exec.movePlayer(playerName,90,45,false,0,50,false)
else
table.insert(blue,playerName)
tfm.exec.setNameColor(playerName, 0x1026E1)
tfm.exec.movePlayer(playerName,1210,45,false,0,50,false)
end
table.remove(playerList,index)
end
end

function eventNewPlayer(playerName)
if not mice[playerName] then
mice[playerName] = {x=0, y=0}
end
for _,key in pairs({0,1,2,3,32}) do
tfm.exec.bindKeyboard(playerName, key, true, true)
end
ui.addTextArea(0, "<p align='center'><font color='#babd2f' size='50' face='Soopafresh'>Ocean of fish", nil, 8, 28, 786, 192, 0x324650, 0x000000, 0, true)
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


function eventKeyboard(playerName, keyCode, down, xPlayerPosition, yPlayerPosition)
mice[playerName].x, mice[playerName].y = xPlayerPosition, yPlayerPosition
if keyCode == 32 then
for n in pairs(mice) do
if pythag(xPlayerPosition, yPlayerPosition, mice[n].x, mice[n].y, range) and playerName ~= n then
tfm.exec.killPlayer(n)
end
end
end
end

table.foreach(tfm.get.room.playerList, eventNewPlayer)

function makeTeams()
local playerList={}
for playerName,player in pairs(tfm.get.room.playerList) do
table.insert(playerList,playerName)
end

for i=1,#playerList,1 do
local index=math.random(#playerList)
local playerName=playerList[index]
if i%2==0 then
table.insert(red,playerName)
tfm.exec.setNameColor(playerName, 0xDE2929)
tfm.exec.movePlayer(playerName,90,45,false,0,50,false)
tfm.exec.addImage("bi8oHEU.png","%"..playerName,-21,-30)
else
table.insert(blue,playerName)
tfm.exec.setNameColor(playerName, 0x1026E1)
tfm.exec.movePlayer(playerName,1210,45,false,0,50,false)
end
table.remove(playerList,index)
end
end

function eventPlayerDied(playerName)
local blueCount,redCount=#blue,#red
for i=1,#blue do
if tfm.get.room.playerList[blue].isDead then
blueCount=blueCount-1
end
end
for i=1,#red do
if tfm.get.room.playerList[red].isDead then
redCount=redCount-1
end
end
if blueCount==0 then
for i=1,#red do
tfm.exec.respawnPlayer(red)
tfm.exec.giveCheese(red)
tfm.exec.playerVictory(red)
end
end
if redCount==0 then
for i=1,#blue do
tfm.exec.respawnPlayer(blue)
tfm.exec.giveCheese(blue)
tfm.exec.playerVictory(blue)
end
end
end

makeTeams()

Dernière modification le 1495724220000
Dramacorn
« Consul »
1495874040000
    • Dramacorn#2857
    • Profil
    • Derniers messages
    • Tribu
#2572
  0
How can I attribute a field skill? For example when you put on a wood to dance
How can I make an area text just come after me? For example, I want a text that can do something like "dancing," and when you hit dancing, just come after me on the map and stay where I set it

Dernière modification le 1495893120000
Borntolol
« Citoyen »
1496355180000
    • Borntolol#0000
    • Profil
    • Derniers messages
    • Tribu
#2573
  0
I need help with making a project with lua, the idea is something similar to town of salem. I dont know if this is possible but if you can i'd be grateful ^^
Honorabilis
« Consul »
1496389080000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2574
  1
Borntolol a dit :
[#What i need] I need help with making a project with lua, the idea is something similar to town of salem. I dont know if this is possible but if you can i'd be grateful ^^ [/#What i need]

I have an idea similar to TOS already. But I am LAZY!

Dernière modification le 1496389140000
Onkei
« Citoyen »
1496396280000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#2575
  0
Honorabilis a dit :
Borntolol a dit :
[#What i need] I need help with making a project with lua, the idea is something similar to town of salem. I dont know if this is possible but if you can i'd be grateful ^^ [/#What i need]

I have an idea similar to TOS already. But I am LAZY!

We can work on it together if you want :D
Honorabilis
« Consul »
1496397060000
    • Honorabilis#0000
    • Profil
    • Derniers messages
    • Tribu
#2576
  0
Onkei a dit :
Honorabilis a dit :
Borntolol a dit :
[#What i need] I need help with making a project with lua, the idea is something similar to town of salem. I dont know if this is possible but if you can i'd be grateful ^^ [/#What i need]

I have an idea similar to TOS already. But I am LAZY!

We can work on it together if you want :D

Oh, summer holiday is coming! So, why not? :P
Eden
« Citoyen »
1496448780000
    • Eden#1533
    • Profil
    • Derniers messages
#2577
  0
the script of the new event?
Dramacorn
« Consul »
1496497680000
    • Dramacorn#2857
    • Profil
    • Derniers messages
    • Tribu
#2578
  0
Does somebody have that script in which you press a button and you collect an object (press space and dance)?

Dernière modification le 1496560140000
Noonicknames
« Citoyen »
1496571240000
    • Noonicknames#0000
    • Profil
    • Derniers messages
    • Tribu
#2579
  0
Dramatotala a dit :
Does somebody have that script in which you press a button and you collect an object (press space and dance)?

ui.addTextArea(2, "<a href='event:Test'>Click Me</a>", nil, 400, 200, 61, 20, 0xff0000, 0x000000, 0.3, false)

function eventTextAreaCallback(id, name, cb)
if cb == "Test" then -- if player clicks on button with that callback name
print (name .. " clicked on the button.")
end
end

Just replace Test with something else and put in different text by replacing Click Me with something else

Dernière modification le 1496571360000
Noonicknames
« Citoyen »
1497072300000
    • Noonicknames#0000
    • Profil
    • Derniers messages
    • Tribu
#2580
  0
I need help to make a killing system so that if you are the police and press space 5 pixels or nearer away from the murderer he'll die.

Currently:

police = "Noonicknames"
murderer = "Souris"

tfm.exec.bindKeyboard(police, 32, true, true)

function eventKeyboard(name, key, down, x, y)
if key == 32 then
if name == police then
policeP = true
policeX = x
policeY = y
end
if policeP == true then
if name == murderer then
for i = (policeY - 5), 10, 1 do
if i == y then
killMX = true
end
end
for i = (policeX - 5), 10, 1 do
if i == x then
killMY = true
end
end
end
end
end
if killMX == true and killMY == true then
tfm.exec.killPlayer(murderer)
end
killMX = false
killMY = false
policeP = false
policeX = nil
policeY = nil
end
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 129 / 160 › »
© Atelier801 2018

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

Version 1.27