mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
maybe help with desync idk
This commit is contained in:
@@ -17,21 +17,21 @@ end
|
||||
commands.add_command('set-home', 'Set Your Home Possition', {}, function(event,args)
|
||||
local player = Game.get_player(event)
|
||||
if not _homes()[player.index] then _homes()[player.index] = {player.force.get_spawn_position(player.surface),player.force.get_spawn_position(player.surface)} end
|
||||
_homes()[player.index][1] = player.position
|
||||
_homes()[player.index][1] = {math.floor(player.position.x),math.floor(player.position.y)}
|
||||
player_return('Home set at: ('..math.floor(player.position.x)..','..math.floor(player.position.y)..')')
|
||||
end)
|
||||
|
||||
commands.add_command('home', 'Goto you home possition', {}, function(event,args)
|
||||
local player = Game.get_player(event)
|
||||
if not _homes()[player.index] then _homes()[player.index] = {player.force.get_spawn_position(player.surface),player.force.get_spawn_position(player.surface)} end
|
||||
_homes()[player.index][2] = player.position
|
||||
_homes()[player.index][2] = {math.floor(player.position.x),math.floor(player.position.y)}
|
||||
player.teleport(player.surface.find_non_colliding_position('player',_homes()[player.index][1],32,1),player.surface)
|
||||
end)
|
||||
|
||||
commands.add_command('return', 'Goto where you were before using /home', {}, function(event,args)
|
||||
local player = Game.get_player(event)
|
||||
if not _homes()[player.index] then _homes()[player.index] = {player.force.get_spawn_position(player.surface),player.force.get_spawn_position(player.surface)} end
|
||||
local _temp = player.position
|
||||
local _temp = {math.floor(player.position.x),math.floor(player.position.y)}
|
||||
player.teleport(player.surface.find_non_colliding_position('player',_homes()[player.index][2],32,1),player.surface)
|
||||
_homes()[player.index][2] = _temp
|
||||
end)
|
||||
Reference in New Issue
Block a user