Skip to content

関数 ​

次に、関数を書きます。 各関数にはテーブルが割り当てられています。このように関数を呼びます。

lua
OnTick(function()
    LocalPlayer.Swing(4)
end)

基本的な定義 ​

Nature Client のスクリプトには、次のような構造体が含まれています。

Vec2 - 2つの小数

Vec3 - 3つの小数

Vec4 - 4つの小数

Color4 - 4つの小数, 色を表現するために使用します。

使用例: Vec2.new(100, 100)

Nature ​

GetVersion ​

戻り値: String

スクリプトを使用するNatureのバージョンを取得します。

GetDisplay ​

戻り値: String

表示上のクライアント名を取得します。

SetDisplay ​

戻り値: Void 因数1: String, Display

クライアントの表示上の名前を変更します。

Shutdown ​

戻り値: Void

クライアントが Uninject されます。

Notification ​

Add ​

戻り値: Void 因数1: String, Title 因数2: String, Message 因数3: Float, Duration

Notification をクライアントに送信します。

User ​

GetUsername ​

戻り値: String

Nature Client のユーザー名を取得します。

GetRole ​

戻り値: String

Nature Client のロールを取得します

Math ​

WorldToScreen ​

戻り値: Vec2 因数1: Vec3, WorldPos

ワールドの位置から、画面の位置へ変換します。

Color ​

GetColor ​

戻り値: Color 因数1: Float, Seconds 因数2: Float, Alpha 因数3: Int, Index

Interface モジュールと同じWaveカラーを取得します。

GetRainbow ​

戻り値: Color 因数1: Float, Seconds 因数2: Float, Saturation 因数3: Float, Alpha 因数4: Int, Index

虹色を取得します。

GetWave ​

戻り値: Color 因数1: Color4, First 因数2: Color4, Second 因数3: Float, Seconds 因数4: Float, Saturation 因数5: Float, Alpha 因数6: Int Index

Waveカラーを取得します。

Chat ​

DisplayChatMessage ​

戻り値: Void Arg1: String, Message

メッセージをクライアント上で表示します。

DisplayNatureMessage ​

戻り値: Void 因数1: String, Message

Nature のメッセージをクライアント上で表示します。

LocalPlayer ​

Swing ​

戻り値: Void 因数1: Int, SwingSource

プレイヤーが Swing します。

ソース: SwingSource

IsOnFire ​

戻り値: Bool

火の中にプレイヤーがいるかを取得します

IsImmobile ​

戻り値: Bool

動けない状態であるかを取得します。

IsDestroyingBlock ​

戻り値: Bool

プレイヤーがブロックを壊しているかを取得しますします。

GetDisplayName ​

戻り値: String

プレイヤーの表示上の名前を取得します。

GetEntityIdentifier ​

戻り値: String

プレイヤーのエンティティの識別子を取得します。

IsOnGround ​

戻り値: Bool

プレイヤーが地面についているかどうかを取得します。

GetPosition ​

戻り値: Vec3

プレイヤーの位置を取得します。

SetPosition ​

戻り値: Void 因数1: Vec3, NewPos

プレイヤーの位置を変更します。

GetPositionDelta ​

戻り値: Vec3

プレイヤーの PositionDelta を取得します。

SetPositionDelta ​

戻り値: Void 因数1: Vec3, NewPosDelta

プレイヤーの PositionDelta を変更します。

Packet ​

SendSwing ​

戻り値: Void 因数1: Int, SwingSource

サーバーにプレイヤーが Swing している状態を送ります。

ソース: SwingSource

Render ​

IsHovering ​

戻り値: Bool 因数1: Vec4, Rect

カーソルが因数1の枠内に存在するかを取得します。

Text ​

戻り値: Void 因数1: Float, Size 因数2: Vec2, Pos 因数3: Vec4, Color 因数4: String, Text 因数5: Int, Font

文字を描画します。

Rect ​

戻り値: Void 因数1: Bool, Filled 因数2: Float, Round 因数3: Float, Thickness 因数4: Vec4, Pos 因数5: Vec4, Color

四角形を描画します。

GetScreenSize ​

戻り値: Vec2

画面のサイズを取得します。

GetMousePos ​

戻り値: Vec2

マウスの位置を取得します。

最後に、クラスの一覧です。