11-11-2015, 10:26 PM
Just got through looking at your API file. Is there a simple way I am missing to get coordinate points of a cuboid selection, or would I have to use the ExecuteString function? If the latter, does this look correct?
local playerName = cPlayer:GetName() local fnString = [[function(a_Player) local Sel = cRoot:Get():FindAndDoWithPlayer(a_Player,GetPlayerState).selection -- is this syntax even legit? I feel like it should be am not certain local ret = {} assert(Sel:IsValid(),"No cuboid selection found!") ret.X1, ret.X2 = Sel:GetXCoordsSorted() ret.Y1, ret.Y2 = Sel:GetYCoordsSorted() ret.Z1, ret.Z2 = Sel:GetZCoordsSorted() return ret end]] -- Or can I pass a cPlayer through and skip the FindAndDoWithPlayer? I read that passing objects is weird and unsupported, so I went the above method. local sel, msg = cRoot:Get():GetPluginManager():CallPlugin("WorldEdit","ExecuteString",fnString,playerName)