How to get owner of construction robot?
How to get owner of construction robot?
Hi all! How to get the owner of the construction robot? Player index for personal roboport or nothing, if it was from standard roboport.
Re: How to get owner of construction robot?
I stumbled over this, when searching an answer for this question.
My solution on this is now, that the robot has a force and not a unique owner.
So, the owners are all players of the force
My solution on this is now, that the robot has a force and not a unique owner.
So, the owners are all players of the force
Code: Select all
local players = {}
for _, player in pairs(game.players) do
if player.force.name == robot.force.name then
table.insert(players, player)
end