From 1d965bebefe11f1fd5e34c686058fa932bb6b82e Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 19 May 2019 13:20:44 +0500 Subject: Implemented GameState lua-api --- cwd/assets/altcraft/scripts/init.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cwd/assets') diff --git a/cwd/assets/altcraft/scripts/init.lua b/cwd/assets/altcraft/scripts/init.lua index 2137464..de58b90 100644 --- a/cwd/assets/altcraft/scripts/init.lua +++ b/cwd/assets/altcraft/scripts/init.lua @@ -20,9 +20,15 @@ function plugin.onUnload () end function plugin.onTick (deltaTime) - if AC.GetGameState() and AC.GetGameState():GetPlayer() then - local player = AC.GetGameState():GetPlayer() - player.pos.x = player.pos.x + deltaTime * 0.5 + if AC.GetGameState() and AC.GetGameState():GetPlayer() and AC.GetGameState():GetTimeStatus().worldAge > 0 then + -- local player = AC.GetGameState():GetPlayer() + -- player.pos.x = player.pos.x + deltaTime * 0.5 + + -- local playerPos = AC.GetGameState():GetPlayer().pos + -- local wrld = AC.GetGameState():GetWorld() + -- playerPosV = Vector.new(playerPos.x, playerPos.y - 1, playerPos.z) + -- bid = wrld:GetBlockId(playerPosV) + -- print(bid.id..":"..bid.state) end end -- cgit v1.2.3