ScriptPlayer

Methods

  • player.showCenterLabel(text: string)
    • displays the CenterLabel to the player
  • player.spawnAt(tileX: number, tileY: number)
    • spawns player at the x,y location
  • player.spawnAtLocation(name: string)
    • spawns player at the designated location
  • player.spawnAtMap(spaceHashID: string, mapHashID: string)
    • spawns player in the designated map
  • player.sendUpdated()
    • updates player information
  • player.showWidget(fileName, align, width, height): ScriptWidget
    • displays the designated Widget to the player
  • player.showYoutubeWidget(url, align, width, height): ScriptWidget
    • plays the YouTube video in the link for the player
  • player.playSound(fileName: string, loop: boolean)
    • plays the designated sound for the player
  • player.playSoundLink(link: string, loop: boolean)
    • plays the sound in the provided link for the player
  • player.showBuyAlert(itemName: string, zepPrice: number, callback)
    • displays the purchase window to the player

Fields

  • player.id
    • player ID
  • player.name
    • player name
  • player.tileX
    • player's location on the x axis
  • player.tileY
    • player's location on the y axis
  • player.chatEnabled
    • enable player chat
  • player.chatGroupID
    • if chatGroupID is not 0, then only players with the same chatGroupID will see the chat
  • player.moveSpeed
    • player's moving speed (default = 80)
    • new speed is applied only after calling player.sendUpdated() after the change
  • player.forcePrivateAreaID
    • forces the PrivateArea ID of the player to be set
  • player.sprite: ScriptDynamicResource
    • sets the sprite of the player
    • sets the ScriptDynamicResource value which is loaded using the App.loadSpritesheet() function
  • player.tag: any
    • sets any object to the player according to the will of the developer
Copy link