×

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
« ‹ 20 / 160 › »
Script Requests
Ajanhalilby
1383142740000
    • Ajanhalilby#0000
    • Profil
    • Derniers messages
    • Tribu
#381
[Modéré par Icewolfbob, raison : Spam]
Bumblet
« Citoyen »
1383169140000
    • Bumblet#0000
    • Profil
    • Derniers messages
#382
  0
My request is a script that spawns a certain amount of the object by saying the command "!spawn"
Issey
« Citoyen »
1383177840000
    • Issey#0000
    • Profil
    • Derniers messages
#383
  0
Bumblet a dit :
My request is a script that spawns a certain amount of the object by saying the command "!spawn"

a dit :
function spawnObject(object,value)
object=object or 1
value=value or 1
for i=1,value do
tfm.exec.addShamanObject(object,math.random(800),math.random(400))
end
end

function eventChatCommand(name,c)
local cmd={}
for arg in c:gmatch("[^%s]+") do
table.insert(cmd,arg)
end
if cmd[1]=='spawn' then
spawnObject(cmd[2],cmd[3])
end
end

Arguments are !spawn (item ID) (number of items)
Mateguti
« Citoyen »
1383226080000
    • Mateguti#0000
    • Profil
    • Derniers messages
    • Tribu
#384
  0
I need a code for when the player reaches the hole, follow this map, as I'm running the time I have left when all users entered -'
Jordy
« Consul »
1383226980000
    • Jordy#0015
    • Profil
    • Derniers messages
    • Tribu
#385
  0
Mateguti a dit :
I need a code for when the player reaches the hole, follow this map, as I'm running the time I have left when all users entered -'

Sorry. I'm not sure what you are talking about.
Mateguti
« Citoyen »
1383228000000
    • Mateguti#0000
    • Profil
    • Derniers messages
    • Tribu
#386
  0
Jordynl a dit :
Sorry. I'm not sure what you are talking about.

I complete one map of local maps = {}

and the time continue running

http://prntscr.com/20ytf3
Bushmeister
« Consul »
1383234420000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#387
  0
How can i check for map number (not via chatmessage)? Such as that: if map code = @somecode then print("kkk")
Shamousey
« Consul »
1383234900000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#388
  0
Bushmeister a dit :
How can i check for map number (not via chatmessage)? Such as that: if map code = @somecode then print("kkk")

tfm.get.room.currentMap is the @code of the map, so you can use that.

a dit :
function eventNewGame()
if tfm.get.room.currentMap=="@1" then
print("kkk")
end
end

 
Tailtong
« Citoyen »
1383239040000
    • Tailtong#0000
    • Profil
    • Derniers messages
    • Tribu
#389
  0
Is there any way to get the name of the map creator?

a dit :
print(tfm.get.room.currentMap.." by "..name of map creator)

Shamousey
« Consul »
1383239160000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#390
  0
Tailtong a dit :
Is there any way to get the name of the map creator?

tfm.get.room.xmlMapInfo.xml.author
Bushmeister
« Consul »
1383239520000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#391
  0
Shamousey a dit :
tfm.get.room.currentMap is the @code of the map, so you can use that.

 

Thanks :>
Bumblet
« Citoyen »
1383307500000
    • Bumblet#0000
    • Profil
    • Derniers messages
#392
  0
Could I have another request of when I spawn the amount of objects but I can position where it will go by X Y
Makinit
« Citoyen »
1383309000000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#393
  0
Bumblet a dit :
Could I have another request of when I spawn the amount of objects but I can position where it will go by X Y

example a dit :
function main()
command.addHandler("spawn", spawn);
end

function spawn(player, object, amount, x, y)
for i = 1, tonumber(amount) or 1 do
tfm.exec.addShamanObject(object, tonumber(x) or math.random(800), tonumber(y) or math.random(400))
end
end


function eventChatCommand(player, message)
local args = string.split(message, "%s")
local text = table.remove(args, 1)
command.handle(string.lower(text), player, args)
end

command = {handlers = {}}

function command.addHandler(text, handler)
if command.handlers[text] == nil then
command.handlers[text] = {}
end
table.insert(command.handlers[text], handler)
end

function command.removeHandler(text, handler)
if command.handlers[text] ~= nil then
local index
for i, h in ipairs(command.handlers[text]) do
if handler == h then
index = i
end
end
if index ~= nil then
table.remove(command.handlers[text], index)
if #command.handlers[text] == 0 then
command.handlers[text] = nil
end
end
end
end

function command.handle(text, player, args)
if command.handlers[text] ~= nil then
for i, handler in ipairs(command.handlers[text]) do
handler(player, unpack(args))
end
end
end

function string.split(str, s)
local res = {};
for part in string.gmatch(str, "[^" .. s .. "]+") do
table.insert(res, part)
end
return res;
end

-- system unpack is unavailable
function unpack (t, i)
i = i or 1
if t ~= nil then
return t, unpack(t, i + 1)
end
end


main()

!spawn 6 3 400 200
Beachking
« Citoyen »
1383328200000
    • Beachking#0000
    • Profil
    • Derniers messages
    • Tribu
#394
  0
How do you make it so that when a shaman spawns 6 arrows he/she will die. Meh Limited arrows. :$
Thanks.
Bushmeister
« Consul »
1383331440000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#395
  0
q a dit :
function eventNewGame()
for pName,player in pairs(tfm.get.room.playerList) do
tfm.exec.bindKeyboard(pName, 37, true, true)
tfm.exec.bindKeyboard(pName, 38, true, true)
tfm.exec.bindKeyboard(pName, 39, true, true)
tfm.exec.bindKeyboard(pName, 40, true, true)
tfm.exec.bindKeyboard(pName, 65, true, true)
tfm.exec.bindKeyboard(pName, 68, true, true)
tfm.exec.bindKeyboard(pName, 83, true, true)
tfm.exec.bindKeyboard(pName, 87, true, true)
keyCodeULastTime[pName] = os.time()
keyCodeUserName[pName] = 20
end
end
keyCodeUserName = {}
keyCodeULastTime = {}
function eventKeyboard(playerName, keyCode, down, xPosition, yPosition)
if tfm.get.room.playerList[playerName].isShaman then
if keyCode == 65 then
keyCodeUserName[playerName] = 20
elseif keyCode == 37 then
keyCodeUserName[playerName] = 20
elseif keyCode == 39 then
keyCodeUserName[playerName] = 19
elseif keyCode == 68 then
keyCodeUserName[playerName] = 19
elseif keyCode == 40 or keyCode == 83 then
if os.time() - keyCodeULastTime[playerName] >= 1000 then
tfm.exec.addShamanObject(keyCodeUserName[playerName], xPosition, yPosition + 15, 0, 0, 0, false)
keyCodeULastTime[playerName] = os.time()
end
end
end
end

Object won't changes when i press A(keycode 65) button. When i changed A to B (keycode 66) it worked. What's wrong with?
Makinit
« Citoyen »
1383345780000
    • Makinit#0095
    • Profil
    • Derniers messages
    • Tribu
#396
  0
Beachking a dit :
How do you make it so that when a shaman spawns 6 arrows he/she will die. Meh Limited arrows. :$
Thanks.

example a dit :
arrowCount = 0

function eventNewGame()
arrowCount = 0
end

function eventSummoningEnd(name, type)
if type == tfm.enum.shamanObject.arrow then
arrowCount = arrowCount + 1
if arrowCount == 6 then
tfm.exec.killPlayer(name)
end
end
end

Bushmeister a dit :
Object won't changes when i press A(keycode 65) button. When i changed A to B (keycode 66) it worked. What's wrong with?

That's a bug that has to do with keyboard layouts. The W key triggers an event with the Z keycode, the A key triggers an event with the Q keycode and vice versa.
Mousechris
« Censeur »
1383350100000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#397
  0
Makinit a dit :
That's a bug that has to do with keyboard layouts. The W key triggers an event with the Z keycode, the A key triggers an event with the Q keycode and vice versa.

Actually I found out it matters if you're using a French or English keyboard. So it's not a bug but just a matter of your keyboard, there's a command to switch keyboards, however I don't know what it is, all i know is Meeyo used it so she could switch to Z commands in the *#Iced! testing room yestarday.
Shamousey
« Consul »
1383350760000
    • Shamousey#0095
    • Profil
    • Derniers messages
    • Tribu
#398
  0
Mousechris a dit :
Actually I found out it matters if you're using a French or English keyboard. So it's not a bug but just a matter of your keyboard, there's a command to switch keyboards, however I don't know what it is, all i know is Meeyo used it so she could switch to Z commands in the *#Iced! testing room yestarday.

The command is /clavier but that has no effect on module key bindings.
Mousechris
« Censeur »
1383350760000
    • Mousechris#0000
    • Profil
    • Derniers messages
    • Tribu
#399
  0
Shamousey a dit :
The command is /clavier but that has no effect on module key bindings.

It seemed to with Meeyo, she used it to switch between the two
Bushmeister
« Consul »
1383383040000
    • Bushmeister#0000
    • Profil
    • Derniers messages
    • Tribu
#400
  0
Makinit a dit :
That's a bug that has to do with keyboard layouts. The W key triggers an event with the Z keycode, the A key triggers an event with the Q keycode and vice versa.

lol. thanks!
upd
I need a script, that will put one random player into one team, and remaining - in other team. Is this possible?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 20 / 160 › »
© Atelier801 2018

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

Version 1.27