qznc wrote:However, I did not find a callback for player movement, direction change, button press, or something similiar.
No. This is because scripts are server side and immense lag would be caused.
Player movementWhat you can do is make a global on step that records player positions, and see if it has moved from the last check.
To do this, store each player in a table with their position. In the global on step, check though each entry to see if they have moved.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
-- table definition
players = {
}
-- on player join
local name = -- get the players name
players[name]={}
players[name].object = player
players[name].pos = player:getpos()
Button presscurrently not possible, sorry.