📗Scripting API
Explaining how to create and run a custom mod
Last updated
Game.PrintHealth()
-- or
Game.AddToInventory("Items.money", 500)print(player:IsNaked())
print(player:IsMoving())
player:OnDied()gameTime = GetSingleton("gameTimeSystem")
print(gameTime:GetGameTime())
gameTime:SetGameTimeByHMS(12,0,0) -- 12h0m0splayer = Game.GetPlayer()
if player:IsNaked() then
player:OnDied() -- kill the player if it's naked
endplayer = Game.GetPlayer()
ts = Game.GetTransactionSystem()
tid = TweakDBID.new("Items.money")
itemid = ItemID.new(tid)
result = ts:GiveItem(player, itemid, 100000)
if result then
print("We added " .. tostring(itemid) .. " to the inventory!")
else
print("Failed to add " .. tostring(itemid))
endplayer = Game.GetPlayer()
dmp = Dump(player, false)
print(dmp)type = DumpType("gameItemID", false)
print(type)