D 1
delimuratt
melankolıa18 1
melankolıa18
shrpnl 1
shrpnl
Fethi Polat 1
Fethi Polat
kralhakan2009 1
kralhakan2009
Vahsi Uzman 1
Vahsi Uzman
Best Studio 1
Best Studio
Agora Metin2 1
Agora Metin2
raderde 1
raderde
Cannn6161 1
Cannn6161
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

Lua oluşturma için kodlar

  • Konuyu başlatan Konuyu başlatan Topal Sirin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 3
  • Görüntüleme Görüntüleme 843

Topal Sirin

Level 6
Fahri Üye
TM Üye
Katılım
19 Ağu 2014
Konular
678
Mesajlar
1,318
Online süresi
15h 51m
Reaksiyon Skoru
38
Altın Konu
0
TM Yaşı
11 Yıl 9 Ay 23 Gün
Başarım Puanı
182
MmoLira
-10
DevLira
0
Ticaret - 0%
0   0   0

ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!

========================================
##### Events
========================================


eventChatCommand(String playerName, String message)
• This event triggers when the player types a message beginning with « ! » in the chat.

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

eventEmotePlayed(String playerName, Int emoteId)
• This event triggers when the player does an emote.

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

eventFileLoaded(String fileName, String file)
• This event triggers when a file is loaded.

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

eventFileSaved(String fileName)
• This event triggers when a file is saved.

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

eventKeyboard(String playerName, Int keyCode, Boolean down, Int xPlayerPosition, Int yPlayerPosition)
• This event triggers when a player presses a key.

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

eventMouse(String playerName, Int xMousePosition, Int yMousePosition)
• This event triggers when a player click his mouse.

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

eventLoop(Int currentTime, Int timeRemaining)
• This event occurs every 500 miliseconds.

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

eventNewGame()
• This event triggers at the start of a new game.

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

eventNewPlayer(String playerName)
• This event triggers when a new player joins the room.

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

eventPlayerDataLoaded(String playerName, String data)
• This event triggers when the data is loaded.

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

eventPlayerDied(String playerName)
• This event triggers when a player dies.

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

eventPlayerGetCheese(String playerName)
• This event triggers when a player gets the cheese.

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

eventPlayerLeft(String playerName)
• This event triggers when a player leaves the room.

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

eventPlayerVampire(String playerName)
• This event triggers when a player transforms into a vampire.

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

eventPlayerWon(String playerName, Int timeElapsed, Int timeElapsedSinceRespawn)
• This event triggers when a player wins the round.

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

eventPlayerRespawn(String playerName)
• This event triggers when a player respawn.

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

eventPopupAnswer(Int popupId, String playerName, String answer)
• This event triggers when a player answer to a popup.

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

eventSummoningStart(String playerName, Int objectType, Int xPosition, Int yPosition, Int angle)
• This event triggers when a player starts an invocation.

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

eventSummoningCancel(String playerName)
• This event triggers when a player cancels an invocation.

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

eventSummoningEnd(String playerName, Int objectType, Int xPosition, Int yPosition, Int angle, Int xSpeed, Int ySpeed, Table other)
• This event triggers when a player has finished an invocation.

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

eventTextAreaCallback(Int textAreaId, String playerName, String callback)
• This event triggers when a player clicks on a flash text event. Example : <a href="event:callbackString">Click here</a>. If the string callback begins with '#clear,' the text area is cleared.



========================================
##### Functions
========================================


print(String something)
• Print something.

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

system.exit()
• Deactivates the lua script running.

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

system.newTimer(Function callback, Int time, Boolean loop, Object arg1, Object arg2, Object arg3, Object arg4)
• Create a new timer. Return the new timer id. Use system.removeTimer(timerId) to stop a timer.

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

system.removeTimer(Int timerId)
• Remove a timer.

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

system.loadFile(Int fileNumber)
• Load a file. Call limited to once per 10 minutes. Returns true if loading has started.

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

system.saveFile(String data, Int fileNumber)
• Save a file. Call limited to once per 10 minutes. Returns true if saving has started.

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

system.loadPlayerData(String playerName)
• Loads the player's data for this module. Calls eventPlayerData when it's done. WARNING : eventPlayerData return # if player's data are not loaded yet server side.

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

system.savePlayerData(String playerName, String data)
• Saves the player's data for this module.

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

system.disableChatCommandDisplay(String command, Boolean yes)
• Deactivates the display of a command in the chat window (100 max).

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

system.bindMouse(String playerName, Boolean yes)
• Listens to the player's mouse events.

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

debug.disableEventLog(Boolean yes)
• Deactivates the events log.

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

debug.disableTimerLog(Boolean yes)
• Deactivates the timers log.

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

tfm.exec.addImage(String imageName, String target, Int xPosition, Int yPosition, String targetPlayer)
• Add an image to the map. Target can be :
#mobileId
$playerName
%playerName
?backgroundLayerDepth
_groundLayerDepth
!foregroundLayerDepth
&fixedLayerDepth
Return an image id. If targetPlayer is NIL, it sends it to all players.

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

tfm.exec.removeImage(Int imageId)
• Remove an image.

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

ui.addPopup(Int id, Int type, String text, String targetPlayer, Int x, Int y, Int width, Boolean fixedPos (false))
• Add a popup. Popup type : 0 (simple), 1 (yes or no), 2 (player input). If targetPlayer is NIL, it sends it to all players.

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

ui.addTextArea(Int id, String text, String targetPlayer, Int x, Int y, Int width, Int height, Int backgroundColor, Int borderColor, Float backgroundAlpha,Boolean fixedPos (false))
• Add a text area. If targetPlayer is NIL, it sends it to all players.

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

ui.updateTextArea(Int id, String text, String targetPlayer)
• Update a text area. If targetPlayer is NIL, it sends it to all players.

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

ui.removeTextArea(Int id, String targetPlayer)
• Remove a text area. If targetPlayer is NIL, it sends it to all players.

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

tfm.exec.addConjuration(Int xPosition, Int yPosition, Int timeInMillis)
• Add conjuration to the map.

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

tfm.exec.addJoint(Int id, Int physicObject1, Int physicObject2, Table jointDef)
• Adds a joint between two physic objects.
jointDef properties are:
- type (Int): 0 -> distance joint, 1 -> prismatic joint, 2 -> pulley joint, 3 -> revolute joint
- point1 (String "x,y"): location of the ground1 anchor (default: the ground1's center)
- point2 (String "x,y"): location of the ground2 anchor (default: the ground2's center), only used with distance and pulley joints
- point3 (String "x,y"), point4 (String "x,y"): locations of the pulley's anchors, only used with pulley joints
- frequency (Float), damping (Float): distance joints' frequency and damping ratio
- axis (String "x,y"), angle (Int): prismatic joints' axis and angle
- limit1 (Float), limit2 (Float), forceMotor (Float), speedMotor (Float): prismatic and revolute joints' translation/rotation limits and motors
ratio (Float): revolute joints' ratio
- line (Int), color (Int), alpha (Float), foreground (Boolean): if none of these properties is defined, the joint won't be drawn
Note: On the map editor, players can also add a 'lua="id"' property in a joint definition in the XML code to be able to interact with it with LUA code.

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

tfm.exec.addPhysicObject(Int id, Int xPosition, Int yPosition, Table bodyDef)
• Adds a physic object into the game.
bodyDef properties are the same as the map editor ones:
- type (Int), width (Int), height (Int), foreground (Boolean), friction (Float), restitution (Float), angle (Int), color (Int), miceCollision (Boolean), groundCollision (Boolean)
- dynamic (Boolean), fixedRotation (Boolean), mass (Int), linearDamping (Float), angularDamping (Float) for dynamic grounds
Note: On the map editor, players can also add a 'lua="id"' property in a ground definition in the XML code to be able to interact with it with LUA code.

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

tfm.exec.addShamanObject(Int objectId, Int xPosition, Int yPosition, Int angle, Int xSpeed, Int ySpeed, Boolean ghost)
• Adds a Shaman object into the game.

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

tfm.exec.bindKeyboard(String playerName, Int keyCode, Boolean down, Boolean yes)
• Listens to the player's keyboard events.

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

tfm.exec.chatMessage(String message, String playerName)
• Sends a message to all the players in the room. If playerName isn't NIL, the message is sent to this player only.

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

tfm.exec.disableAfkDeath(Boolean yes)
• Desactivates the automatic afk death.

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

tfm.exec.disableAllShamanSkills(Boolean yes)
• Desactivates all shaman skills.

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

tfm.exec.disableAutoNewGame(Boolean yes)
• Deactivates the automatic renewal of rounds.

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

tfm.exec.disableAutoScore(Boolean yes)
• Deactivates the automatic scoring management.

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

tfm.exec.disableAutoShaman(Boolean yes)
• Deactivates the automatic selection of Shaman.

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

tfm.exec.disableAutoTimeLeft(Boolean yes)
• Deactivates the automatic time change.

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

tfm.exec.displayParticle(Int particleId, Int xPosition, Int yPosition, Float xSpeed, Float ySpeed, Float xAcceleration, Float yAcceleration, StringtargetPlayer)
• Add a particle. If targetPlayer is NIL, it sends it to all players.

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

tfm.exec.explosion(Int xPosition, Int yPosition, Int power, Int distance, Boolean miceOnly)
• Throw an explosion.

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

tfm.exec.giveCheese(String playerName)
• Gives the cheese to a player.

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

tfm.exec.giveMeep(String playerName)
• Gives the meep competence to a player.

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

tfm.exec.killPlayer(String playerName)
• Kills the selected player.

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

tfm.exec.moveObject(Int objectId, Int xPosition, Int yPosition, Boolean offset, Int xSpeed, Int ySpeed, Boolean offset)
• Defines the speed and position of an object.

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

tfm.exec.movePlayer(String playerName, Int xPosition, Int yPosition, Boolean offset, Int xSpeed, Int ySpeed, Boolean offset)
• Defines the speed and position of a player.

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

tfm.exec.newGame(String mapCode)
• Launch a new game. Use : 6 (vanilla map), @42583 (editor map), #4 (perm category map), begin with '<' (xml map)

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

tfm.exec.playerVictory(String playerName)
• Gives the victory to a player.

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

tfm.exec.removeJoint(Int id)
• Removes a joint from the game.

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

tfm.exec.removeObject(Int objectId)
• Remove a physical object.

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

tfm.exec.removePhysicObject(Int id)
• Removes a physic body from the game.

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

tfm.exec.respawnPlayer(String playerName)
• Respawn a player.

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

tfm.exec.setNameColor(String playerName, Int color)
• Changes the player's name's color.

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

tfm.exec.setPlayerScore(String playerName, Int score, Boolean add)
• Set the player's score.

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

tfm.exec.setRoomMaxPlayers(Int maxPlayers)
• Sets the max number of players in a room.

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

tfm.exec.setShaman(String playerName)
• Set a shaman.

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

tfm.exec.setTimeLeft(Int seconds, Boolean init)
• Set the game time.

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

tfm.exec.setUIMapName(String text)
• Set text map name.

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

tfm.exec.setUIShamanName(String text)
• Set text shaman name.

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

tfm.exec.setVampirePlayer(String playerName)
• Set player as vampire.

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

tfm.exec.snow(Int secondes (60), Int snowballPower (10))
• Makes the snow fall.



========================================
##### Lua tree
========================================


_G
ipairs
ui


  • updateTextArea
    removeTextArea
    addPopup
    addTextArea

math


  • deg
    fmod
    random
    asin
    max
    modf
    log10
    floor
    cosh
    ldexp
    log
    pow
    randomseed
    frexp
    abs
    tanh
    acos
    atan2
    tan
    min
    ceil
    sinh
    sqrt
    huge
    rad
    sin
    exp
    cos
    atan
    pi

pcall
assert
tonumber
rawequal
table


  • maxn
    foreachi
    concat
    remove
    insert
    foreach
    sort
    getn

tfm


  • exec
    • addShamanObject
      snow
      disableAutoNewGame
      setShaman
      addImage
      removeJoint
      respawnPlayer
      newGame
      disableAllShamanSkills
      setGameTime
      movePlayer
      removeImage
      chatMessage
      setVampirePlayer
      explosion
      moveObject
      disableAutoScore
      giveCheese
      addPhysicObject
      giveMeep
      displayParticle
      removePhysicObject
      disableAutoTimeLeft
      setPlayerScore
      killPlayer
      addJoint
      setRoomMaxPlayers
      setNameColor
      disableAfkDeath
      removeObject
      addConjuration
      setUIMapName
      setUIShamanName
      playerVictory
      bindKeyboard
      disableAutoShaman

    enum

    • emote
      • sit : 8
        facepaw : 7
        laugh : 1
        sleep : 6
        angry : 4
        confetti : 9
        clap : 5
        cry : 2
        kiss : 3
        dance : 0

      shamanObject

      • bomb : 23
        arrow : 0
        trampoline : 7
        balloon : 28
        box : 2
        rune : 32
        snowBall : 34
        board : 4
        littleBox : 1
        cannon : 19
        ball : 6
        anvil : 10
        iceCube : 54
        littleBoard : 3

    get

    • misc
      • bouboumVersion : 1.16
        transformiceVersion : 2.69
        apiVersion : 0.19

      room

      • community : -
        currentMap : 0
        maxPlayers : 50
        objectList
        name : -
        playerList
        • isJumping
          title : 0
          y : 0
          x : 0
          isDead
          look : 1;0,0,0,0,0,0,0,0,0
          isShaman
          vx : 0
          score : 0
          inHardMode : 0
          vy : 0
          movingRight
          hasCheese
          registrationDate : 0
          playerName : Tigrounette
          movingLeft
          isFacingRight
          isVampire

pairs
os


  • difftime
    time
    date

xpcall
type
error
string


  • len
    find
    gmatch
    byte
    dump
    reverse
    upper
    format
    rep
    lower
    sub
    gsub
    match
    char

debug


  • disableEventLog
    disableTimerLog

tostring
print
next
system


  • disableChatCommandDisplay
    newTimer
    savePlayerData
    bindMouse
    giveEventGift
    exit
    removeTimer
    loadPlayerData
    loadFile
    saveFile
 
Teşekkürler ancak kimisi b ukodların ne işe yaradığını bilmiyor biraz anlatıma döksen iyi olurdu.
 
Tesekkürler.
 
Önemli değil.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst