How to use GetLastBedPos()
#1
Hi,

how i can use GetLastBedPos() for writing in Log?

LOG(Player:GetName() .. " Bed: " .. Player:GetLastBedPos())
Reply
Thanks given by:
#2
You need to explicitly log the individual values:
local lastBedPos = Player:GetLastBedPos()
LOG(string.format("%s Bed: [%d, %d, %d]", Player:GetName(), lastBedPos.x, lastBedPos.y, lastBedPos.z))
(I prefer using string.format to concatenation, but either should work)
Reply
Thanks given by: moiko89
#3
Thanks xoft!
How i can show into Objects in Lua? Can i debug my code?
Reply
Thanks given by:
#4
You can debug Cuberite plugins using the ZeroBrane Studio, there's an article about setting it all up: https://api.cuberite.org/SettingUpZeroBrane.html

There's no built-in way to display Lua objects, basically because a Lua table can contain stuff that it cannot represent reasonably (functions, loops etc.)
Reply
Thanks given by: moiko89




Users browsing this thread: 2 Guest(s)