doc 4 modulo |
Bolodefchoco « Sénateur » Membre 1574535660000
| 0 | ||
• • eventChatCommand ( playerName, command ) This event is triggered when a player uses a chat command (a message beginning with « ! »). Arguments: - playerName (String) : the player who sent the command - command (String) : the message (without the initial « ! ») • eventChatMessage ( playerName, message ) This event is triggered when a player talks in the room chat. Arguments: - playerName (String) : the player who sent the message - message (String) : the message • eventEmotePlayed ( playerName, emoteType, emoteParam ) This event is triggered when the player does an emote. Arguments: - playerName (String) : the player who did the emote - emoteType (Int) : the type of emote played - emoteParam (String) : the parameter used with the emote (only applies to the flag one) • eventFileLoaded ( fileNumber, fileData ) This event is triggered when a file gets fully loaded. Arguments: - fileNumber (String) : the file identifier - fileData (String) : the file data • eventFileSaved ( fileNumber ) This event is triggered when a file gets saved. Arguments: - fileNumber (String) : the name of the file • eventKeyboard ( playerName, keyCode, down, xPlayerPosition, yPlayerPosition ) This event is triggered when a player presses a key. Arguments: - playerName (String) : the player who typed the key - keyCode (Int) : the code of the typed key - down (Boolean) : whether it was the press event, or the release one - xPlayerPosition (Int) : the horizontal coordinate of the player when he or she typed the key - yPlayerPosition (Int) : the vertical coordinate of the player when he or she typed the key • eventMouse ( playerName, xMousePosition, yMousePosition ) This event is triggered when a player perfoms a mouse click. Arguments: - playerName (String) : the player who made the click - xMousePosition (Int) : the horizontal coordinate of the mouse click - yMousePosition (Int) : the vertical coordinate of the mouse click • eventLoop ( elapsedTime, remainingTime ) This event occurs every 500 milliseconds. Arguments: - elapsedTime (Int) : the time in milliseconds elapsed since the beginning of the round - remainingTime (Int) : the time in milliseconds remaining before the next round • eventNewGame () This event is triggered when a new round begins. • eventNewPlayer ( playerName ) This event is triggered when a new player joins the room. Arguments: - playerName (String) : the player who joined the room • eventPlayerDataLoaded ( playerName, playerData ) This event is triggered when player data gets loaded. Arguments: - playerName (String) : the player whose data got loaded - playerData (String) : the data about the player • eventPlayerDied ( playerName ) This event is triggered when a player dies. Arguments: - playerName (String) : the player who died • eventPlayerGetCheese ( playerName ) This event is triggered when a player gets the cheese. Arguments: - playerName (String) : the player who got the cheese • eventPlayerBonusGrabbed ( playerName, bonusId ) This event is triggered when a player grabs a bonus of type 0 (point). Arguments: - playerName (String) : the player who grabbed the bonus - bonusId (Int) : bonus identifier (if the bonus belongs to the map, this will be 0) • eventPlayerLeft ( playerName ) This event is triggered when a player leaves the room. Arguments: - playerName (String) : the player who left the room • eventPlayerVampire ( playerName, vampire ) This event is triggered when a player turns into a vampire. Arguments: - playerName (String) : the player who turned into a vampire - vampire (String) : the vampire who contamined the player (or nil if it hasn't been contamined by another player) • eventPlayerWon ( playerName, timeElapsed, timeElapsedSinceRespawn ) This event triggers when a player enters the hole. Arguments: - playerName (String) : the player who entered the hole - timeElapsed (Int) : the time in milliseconds elapsed since the beginning of the round - timeElapsedSinceRespawn (Int) : the time in milliseconds elapsed since the last respawn • eventPlayerRespawn ( playerName ) This event is triggered when a player respawns. Arguments: - playerName (String) : the player who respawned • eventPlayerMeep ( playerName, xPosition, yPosition ) This event is triggered when a player meeps. Arguments: - playerName (String) : the player who meeped - xPosition (Int) : the horizontal coordinate of the player when they meeped - yPosition (Int) : the vertical coordinate of the player when they meeped • eventPopupAnswer ( popupId, playerName, answer ) This event is triggered when a player answers a popup (only type 1 and 2 popups). Arguments: - popupId (Int) : the popup identifier - playerName (String) : the player who answered the popup - answer (String) : the player's answer - yes or no for a type 1 popup - any string for a type 2 poup • eventSummoningStart ( playerName, objectType, xPosition, yPosition, angle ) This event is triggered when a player starts summoning a shaman object. Arguments: - playerName (String) : the player who started summoning - objectType (Int) : the kind of shaman object being summoned - xPosition (Int) : the horizontal coordinate of the summoning point - yPosition (Int) : the vertical coordinate of the summoning point - angle (Int) : the rotation angle of the object being summoned • eventSummoningCancel ( playerName ) This event is triggered when a player cancels an object invocation. Arguments: - playerName (String) : the player who stopped summoning • eventSummoningEnd ( playerName, objectType, xPosition, yPosition, angle, objectDescription ) This event triggers when a player has finished an invocation. Arguments: - playerName (String) : the player who summoned the object - objectType (Int) : the kind of the object - xPosition (Int) : the horizontal position of the summoned object - yPosition (Int) : the vertical position of the summoned object - angle (Int) : the rotation angle of the summoned object - objectDescription (Table) : the object table description as it would appear in the room's objectList • eventTextAreaCallback ( textAreaId, playerName, eventName ) This event is triggered when a player clicks a text event. Text event links are anchors tags links beginning with the "event:" string (e.g. : <a href="event:callbackString">Click here</a>). If the link eventName begins with '#clear,' the text area will be cleared, and the received eventName will be the text following the coma. Arguments: - textAreaId (Int) : the text area identifier - playerName (String) : the player who clicked - eventName (String) : the name of the clicked text event • eventColorPicked ( colorPickerId, playerName, color ) This event is triggered when a player chooses a color with a color picker. Arguments: - colorPickerId (Int) : the color picker identifier - playerName (String) : the player who picked a color - color (Int) : the color picked (-1 if the player didn't pick one)) • debug.disableEventLog ( activate ) Deactivates the events log. Parameters: - activate (Boolean) : whether it should be active (default value = true) • system.bindKeyboard ( playerName, keyCode, down, activate ) Listens to the player's keyboard events. Parameters: - playerName (String) : the player you want to listen keyboard events from - keyCode (Int) : the code of the key you want to listen - to accurately listen for player movement (both arrows and wasd/zqsd keys), you can use 0 (left), 1 (up), 2 (right) or 3 (down) - regular AS3 keycodes can be found on Adobe website - down (Boolean) : whether it should listen for the press event, or the release one - activate (Boolean) : whether it should be active (default value = true) • system.bindMouse ( playerName, active ) Listens to a player's mouse events. Parameters: - playerName (String) : the player you want to listen mouse events from - active (Boolean) : whether it should be active (default value = true) • system.disableChatCommandDisplay ( command, hide ) Prevents a module command (commands starting with « ! ») to be displayed in the room. If the supplied command is nil, the parameter will apply to all the commands. Parameters: - command (String) : the command (without the initial « ! ») to hide (default value = nil) - hide (Boolean) : whether the command should be hided (default value = true) • system.exit () Deactivates the lua script running. • system.giveEventGift ( playerName, giftCode ) Gives an event reward to the targeted player. Parameters: - playerName (String) : the player to give the gift to - giftCode (String) : the gift identifier (given by an admin) • system.loadFile ( fileNumber ) Requests the loading of a data file. The event eventFileLoaded is triggered when the file gets loaded. Parameters: - fileNumber (Int) : the identifier of the file to load (default value = 0) Returns: (Boolean) whether the loading got started • system.loadPlayerData ( playerName ) Requests the loading of the player's data for this module. The event eventPlayerDataLoaded is triggered when the player data gets loaded. Parameters: - playerName (String) : the player about whom you want to get the data Returns: (Boolean) whether the loading got started • system.newTimer ( callback, time, loop, arg1, arg2, arg3, arg4 ) Creates a new timer to call a function after a delay, once or continuously. Parameters: - callback (Function) : The function to call - time (Int) : the number of milliseconds that the function call should be delayed by - loop (Boolean) : whether the function call should loop or happen only once (default value = false) - arg1 (Object) : 1st argument of the callback function (default value = nil) - arg2 (Object) : 2nd argument of the callback function (default value = nil) - arg3 (Object) : 3rd argument of the callback function (default value = nil) - arg4 (Object) : 4th argument of the callback function (default value = nil) Returns: (Int) the new timer id • system.removeTimer ( timerId ) Destroys a timer. Parameters: - timerId (Int) : the identifier of the timer to stop • system.saveFile ( data, fileNumber ) Requests the saving of a data file (throttled to one per minute). The event eventFileSaved is triggered when the file get saved. Parameters: - data (String) : the data to store in the file - fileNumber (Int) : the identifier (from 0 to 99) of the file to write the data in (default value = 0) Returns: (Boolean) whether the saving got started • system.savePlayerData ( playerName, data ) Saves module data about a player. Please note that this data is per player and per Lua dev, so take care not to overwrite data from another one of your modules. Parameters: - playerName (String) : the player about whom you want to save data - data (String) : the player data to save • tfm.exec.addBonus ( type, x, y, id, angle, visible, targetPlayer ) Adds a defilante bonus to the map, and if it is of type 0 (point), it will trigger eventPlayerBonusGrabbed when someone grabs it. Parameters: - type (Int) : Bonus type (see tfm.enum.bonus) (default value = 1) - x (Int) : X position. (default value = 0) - y (Int) : Y position. (default value = 0) - id (Int) : Identifier. (default value = 0) - angle (Int) : Angle (deg). (default value = 0) - visible (Boolean) : Make the bonus visible or not. (default value = true) - targetPlayer (String) : Send only to this specific player. (default value = nil) • tfm.exec.addConjuration ( xPosition, yPosition, duration ) Adds conjuration to the map. Note: Grid coordinate are regular coordinate divided by 10 (as conjuration is a 10x10 pixel square). Parameters: - xPosition (Int) : the horizontal grid coordinate of the conjuration - yPosition (Int) : the vertical grid coordinate of the conjuration - duration (Int) : the duration of the conjuration in milliseconds (default value = 10000) • tfm.exec.addImage ( imageId, target, xPosition, yPosition, targetPlayer, scaleX, scaleY, angle, alpha, anchorX, anchorY ) Displays an image on the map. Parameters: - imageId (String) : the image identifier - target (String) : the game element to attach the image to - #mobileId - $playerName (on the mouse sprite) - %playerName (with the mouse sprite removed) - ?backgroundLayerDepth - _groundLayerDepth - !foregroundLayerDepth - &fixedLayerDepthBeforeLuaInterfaces - :fixedLayerDepthBehindLuaInterfaces - +physicObjectID - xPosition (Int) : the horizontal offset of the top-left corner of the image (0 being the middle of the game element) (default value = 0) - yPosition (Int) : the vertical offset of the top-left corner of the image (0 being the middle of the game element) (default value = 0) - targetPlayer (String) : the player who will see the image (if nil, applies to all players) (default value = nil) - scaleX (Number) : the X (width) scale of the image (default value = 1) - scaleY (Number) : the Y (height) scale of the image (default value = 1) - angle (Number) : the angle of the image (in radians) (default value = 0) - alpha (Number) : the image opacity (default value = 1) - anchorX (Number) : The horizontal anchor in which the image's angle will use. (from 0 to 1, 0.5 being the center) (default value = 0) - anchorX (Number) : The vertical anchor in which the image's angle will use. (from 0 to 1, 0.5 being the center) (default value = 0) Returns: (Int) the image identifier • tfm.exec.addJoint ( id, ground1, ground2, jointDef ) Adds a joint between two physic objects. . Note: In map XML codes, you can also add a « lua="id" » property in a joint definition to be able to interact with it with Lua code. Parameters: - id (Int) : the identifier of the joint - ground1 (Int) : the first ground the joint will affect - ground2 (Int) : the second ground the joint will affect - jointDef (Table) : the ground description - 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 • tfm.exec.addPhysicObject ( id, xPosition, yPosition, bodyDef ) Spawns a ground. Parameters: - id (Int) : the identifier of the physic object - xPosition (Int) : the horizontal coordinate of the center of the ground - yPosition (Int) : the vertical coordinate of the center of the ground - bodyDef (Table) : the ground description - 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 • tfm.exec.addShamanObject ( objectType, xPosition, yPosition, angle, xSpeed, ySpeed, ghost, options ) Spawns a shaman object. Parameters: - objectType (Int) : the type of the shaman object to spawn - xPosition (Int) : the horizontal position of the spawn - yPosition (Int) : the vertical position of the spawn - angle (Int) : the rotation angle of the object, in degrees (default value = 0) - xSpeed (Int) : the horizontal speed of the object (default value = 0) - ySpeed (Int) : the vertical speed of the object (default value = 0) - ghost (Boolean) : whether the spawned object should be transparent (default value = false) - options (Table) : the object description - fixedXSpeed (Number), fixedYSpeed (Number) Returns: (Int) the shaman object identifier • tfm.exec.attachBalloon ( playerName, isAttached, colorType, ghost, , speed ) Attaches a balloon to player. Parameters: - playerName (String) : the player's nickname - isAttached (Boolean) : whether the balloon should be attached or detached from the player (default value = true) - colorType (Int) : the color type of the balloon [1-4] (default value = 1) - ghost (Boolean) : whether the spawned balloon should be transparent (default value = false) - speed (Number) : the vertical speed of the balloon. (default value = 1) • tfm.exec.changePlayerSize ( playerName, size ) Changes the size of a player. Parameters: - playerName (String) : the player's nickname - size (Number) : the new size of the player (between 0.1 and 5) (default value = 1) • tfm.exec.chatMessage ( message, playerName ) Displays a chat message. Parameters: - message (String) : the chat message to display - playerName (String) : the player who will get the message (if nil, applies to all players) (default value = nil) • tfm.exec.disableAfkDeath ( activate ) Deactivates the automatic afk death. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableAllShamanSkills ( active ) Deactivates all shaman skills. Parameters: - active (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableAutoNewGame ( activate ) Deactivates the automatic renewal of rounds. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableAutoScore ( activate ) Deactivates the automatic scoring management. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableAutoShaman ( activate ) Deactivates the automatic selection of shaman. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableAutoTimeLeft ( activate ) Deactivates the automatic remaining time change to 20s (when the shaman dies for example). Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableDebugCommand ( activate ) Disables the effects of the /debug command. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableMinimalistMode ( activate ) Disables the minimalist mode. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disableMortCommand ( activate ) Disables the /mort command. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disablePhysicalConsumables ( active ) Deactivates physical consumables (like in racing and bootcamp rooms). Parameters: - active (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.disablePrespawnPreview ( display ) Enables or disables the shaman objects prespawn preview. Parameters: - display (Boolean) : whether the prespawn preview should not be displayed (default value = true) • tfm.exec.disableWatchCommand ( activate ) Disables the effects of the /watch command. Parameters: - activate (Boolean) : whether the deactivation should be active (default value = true) • tfm.exec.displayParticle ( particleType, xPosition, yPosition, xSpeed, ySpeed, xAcceleration, yAcceleration, targetPlayer ) Displays a particle. Parameters: - particleType (Int) : the kind of particle you want to display - xPosition (Int) : the horizontal coordinate of the particle - yPosition (Int) : the vertical coordinate of the particle - xSpeed (Number) : the horizontal speed of the particle (default value = 0) - ySpeed (Number) : the vertical speed of the particle (default value = 0) - xAcceleration (Number) : the horizontal acceleration of the particle (default value = 0) - yAcceleration (Number) : the vertical acceleration of the particle (default value = 0) - targetPlayer (String) : the player who should see the particle (if nil, applies to all players) (default value = nil) • tfm.exec.explosion ( xPosition, yPosition, power, radius, miceOnly ) Throws an explosion. Parameters: - xPosition (Int) : the horizontal coordinate of the center of the explosion - yPosition (Int) : the vertical coordinate of the center of the explosion - power (Int) : the maximum power of the explosion - radius (Int) : the explosion radius (players further away won't be affected) - miceOnly (Boolean) : whether the explosion should affect only mice, or objects too (default value = false) • tfm.exec.freezePlayer ( playerName, freeze ) Freezes a player. Parameters: - playerName (String) : the player who is going to be frozen - freeze (Boolean) : if the player should be frozen (default value = true) • tfm.exec.getPlayerSync ( ) Gets the room's sync player. • tfm.exec.giveCheese ( playerName ) Gives the cheese to a player. Parameters: - playerName (String) : the player who should get the cheese • tfm.exec.giveConsumables ( playerName, consumableId, amount ) Gives consumables to the targeted player. Parameters: - playerName (String) : the player to give the gift to - consumableId (String) : the consumable identifier - amount (String) : the amount of consumables to give (default value = "1") • tfm.exec.giveMeep ( playerName, canMeep ) Gives the meep competence to a player, or removes it. Parameters: - playerName (String) : the player's nickname - canMeep (Boolean) : whether the player should be able to meep (default value = true) • tfm.exec.giveTransformations ( playerName, canTransform ) Gives the transformations to a player, or removes them. Parameters: - playerName (String) : the player's nickname - canTransform (Boolean) : whether the player should be able to use transformations (default value = true) • tfm.exec.killPlayer ( playerName ) Kills the selected player. Parameters: - playerName (String) : the player to kill • tfm.exec.linkMice ( playerName1, playerName2, linked ) Allows to link players like in soulmate maps. Parameters: - playerName1 (String) : the first player's nickname - playerName2 (String) : the second player's nickname - linked (Boolean) : whether the two players should be linked (default value = true) • tfm.exec.lowerSyncDelay ( playerName ) Lowers the synchronization delay of a player to 400ms max Parameters: - playerName (String) : the player who should have a lower sync delay • tfm.exec.moveObject ( objectId, xPosition, yPosition, positionOffset, xSpeed, ySpeed, speedOffset, angle, angleOffset ) Defines the speed and position of a shaman object. Parameters: - objectId (Int) : the shaman object identifier - xPosition (Int) : the horizontal coordinate of the point where the object will be moved - yPosition (Int) : the vertical coordinate of the point where the object will be moved - positionOffset (Boolean) : whether the specified position is an offset to apply to the current one, or the absolute one (default value = false) - xSpeed (Int) : the horizontal coordinate of the speed to give to the object (default value = 0) - ySpeed (Int) : the vertical coordinate of the speed to give to the object (default value = 0) - speedOffset (Boolean) : whether the specified speed is an offset to apply to the current one, or the absolute one (default value = false) - angle (Int) : the angle of the the object (default value = 0) - angleOffset (Boolean) : whether the specified angle is an offset to apply to the current one, or the absolute one (default value = false) • tfm.exec.movePlayer ( playerName, xPosition, yPosition, positionOffset, xSpeed, ySpeed, speedOffset ) Defines the speed and position of a player. Parameters: - playerName (String) : the player to move - xPosition (Int) : the horizontal coordinate of the point where the player will be moved - yPosition (Int) : the vertical coordinate of the point where the player will be moved - positionOffset (Boolean) : whether the specified position an offset to apply to the current one, or the absolute one (default value = false) - xSpeed (Int) : the horizontal coordinate of the speed to give to the player (default value = 0) - ySpeed (Int) : the vertical coordinate of the speed to give to the player (default value = 0) - speedOffset (Boolean) : whether the specified speed an offset to apply to the current one, or the absolute one (default value = false) • tfm.exec.newGame ( mapCode, flipped ) Starts a new game Parameters: - mapCode (String) : the map code (default value = nil) - nil (a random map) - 6 (vanilla map) - @42583 (editor map) - #4 (perm category map) - anything beginning with '<' (xml map) - flipped (Boolean) : whether the map should be flipped (default value = nil (randomly mirrored in racing and bootcamp rooms, unless)) • tfm.exec.playEmote ( playerName, emoteId, emoteArg ) Makes a player do an emote. Parameters: - playerName (String) : the player who should do the emote - emoteId (Int) : the emote to do - emoteArg (String) : the emote attribute (for the flag emote for example) (default value = nil) • tfm.exec.playerVictory ( playerName ) Makes a player enter the hole. It only works if the player already has a cheese! Parameters: - playerName (String) : the player who should win • tfm.exec.removeBonus ( id, targetPlayer ) Removes a bonus previously spawned with tfm.exec.addBonus Parameters: - id (Int) : Identifier. (default value = 0) - targetPlayer (String) : Send only to this specific player. (default value = nil) • tfm.exec.removeCheese ( playerName ) Takes away the cheese from a player. Parameters: - playerName (String) : the player who should get their cheese removed • tfm.exec.removeImage ( imageId ) Removes an image. Parameters: - imageId (Int) : the image identifier • tfm.exec.removeJoint ( id ) Removes a joint from the game. Parameters: - id (Int) : the identifier of the joint to remove • tfm.exec.removeObject ( objectId ) Removes a shaman object. Parameters: - objectId (Int) : the shaman object identifier • tfm.exec.removePhysicObject ( id ) Removes a ground from the game. Parameters: - id (Int) : the identifier of the ground to remove • tfm.exec.respawnPlayer ( playerName ) Respawns a player. Parameters: - playerName (String) : the player to respawn • tfm.exec.setAutoMapFlipMode ( flipped ) Sets whether the following maps should be flipped (always, never, or TFM's default behaviour). Parameters: - flipped (Boolean) : whether the maps should be flipped (default value = nil (the default TFM behaviour)) • tfm.exec.setGameTime ( time, init ) Sets the game remaining time. Parameters: - time (Int) : the remaining time in seconds - init (Boolean) : whether the remaining time should change even if the specified remaining time is higher than the current one (default value = true) • tfm.exec.setNameColor ( playerName, color ) Changes a player's nickname's color. Parameters: - playerName (String) : the player whose nickname should be colored - color (Int) : the color of the nickname • tfm.exec.setPlayerScore ( playerName, score, add ) Sets the player's score. Parameters: - playerName (String) : the player who should get his or her score changed - score (Int) : the score - add (Boolean) : whether the current score should be added to the specified one (default value = false) • tfm.exec.setPlayerSync ( playerName ) Defines the new room's sync player. Parameters: - playerName (String) : the username of the player who is going to be the sync. Use nil for the server to choose. • tfm.exec.setRoomMaxPlayers ( maxPlayers ) Sets the max number of players in a room. Parameters: - maxPlayers (Int) : the maximum number of players the room can hold • tfm.exec.setRoomPassword ( password ) Password-protects a room. Parameters: - password (String) : the string to set as the password (an empty string removes the protection) • tfm.exec.setShaman ( playerName, makeAShaman ) Makes a player a shaman. Parameters: - playerName (String) : the player who should become a shaman - makeAShaman (Boolean) : whether the player should be a shaman (default value = true) • tfm.exec.setShamanMode ( playerName, mode ) Changes the shaman mode of a player. Parameters: - playerName (String) : the player's nickname who will have another shaman mode - mode (Int) : the new shaman mode of the target (use nil to use the player's real mode) (default value = nil) • tfm.exec.setVampirePlayer ( playerName, makeAVampire ) Makes a player a vampire. Parameters: - playerName (String) : the player to make a vampire - makeAVampire (Boolean) : whether the player should be a vampire (default value = true) • tfm.exec.setWorldGravity ( x, y ) Allows you to change the world forces on the x axis (wind) and on the y axis (gravity). Parameters: - x (Int) : force on the x axis (wind) (default value = 0) - y (Int) : force on the y axis (gravity) (default value = 10) • tfm.exec.snow ( duration, snowballPower ) Makes the snow fall. Parameters: - duration (Int) : the snowfall duration in seconds (default value = 60) - snowballPower (Int) : (default value = 10) • ui.addPopup ( id, type, text, targetPlayer, x, y, width, fixedPos ) Displays a popup. Parameters: - id (Int) : the identifier of the popup - type (Int) : the popup type (0 for simple, 1 for yes or no, 2 for player input) - text (String) : the text to display - targetPlayer (String) : the player who will see the popup (if nil, applies to all players) - x (Int) : the horizontal coordinate of the top-left corner (default value = 50) - y (Int) : the vertical coordinate of the top-left corner (default value = 50) - width (Int) : the width in pixels of the popup (if 0, it will be ajusted to the text width) (default value = 0) - fixedPos (Boolean) : whether the position is fixed or if it should follow the player's camera on long maps (default value = false) • ui.addTextArea ( id, text, targetPlayer, x, y, width, height, backgroundColor, borderColor, backgroundAlpha, fixedPos ) Displays a text area. Parameters: - id (Int) : the identifier of the text area - text (String) : the text to display - targetPlayer (String) : the player who will see the text area (if nil, applies to all players) (default value = nil) - x (Int) : the horizontal coordinate of the top-left corner (default value = 50) - y (Int) : the vertical coordinate of the top-left corner (default value = 50) - width (Int) : the width in pixels of the text area (if 0, it will be ajusted to the text width) (default value = 0) - height (Int) : the height in pixels of the text area (if 0, it will be ajusted to the text height) (default value = 0) - backgroundColor (Int) : the background color of the text area (default value = 0x324650) - borderColor (Int) : the border color of the text area (default value = 0) - backgroundAlpha (Number) : the background's opacity, from 0 (transparent) to 1 (opaque) (default value = 1) - fixedPos (Boolean) : whether the position is fixed or if it should follow the player's camera on long maps (default value = false) • ui.removeTextArea ( id, targetPlayer ) Removes a text area. Parameters: - id (Int) : the identifier of the text area - targetPlayer (String) : the player whom the text area will disappear (if nil, applies to all players) (default value = nil) • ui.setMapName ( text ) Sets the map name. Parameters: - text (String) : the text to display as the map name • ui.setShamanName ( text ) Sets the shaman name. Parameters: - text (String) : the text to display as the shaman name • ui.showColorPicker ( id, targetPlayer, defaultColor, title ) Displays a color picker. Parameters: - id (Int) : the identifier of the color picker - targetPlayer (String) : the player who will see the color picker (if nil, applies to all players) (default value = nil) - defaultColor (Int) : the default color on the color picker (default value = 0) - title (String) : the title of the color picker (default value = nil) • ui.updateTextArea ( id, text, targetPlayer ) Updates the content of a text area. Parameters: - id (Int) : the identifier of the text area - text (String) : the new text to display - targetPlayer (String) : the player who will get displayed the new text (if nil, applies to all players) (default value = nil) • Dernière modification le 1636043460000 |