05-19-2013, 08:46 PM
MCServer sometimes gives the wrong X and Z coordinates. Ive noticed this while i was working on my WorldEdit plugin. i was adding a command that changes all the block above you to air blocks but it kept changing the blocks next to me. This was the code i used:
function HandleRemoveAboveCommand( Split, Player ) X = Player:GetPosX() y = Player:GetPosY() Z = Player:GetPosZ() World = Player:GetWorld() RemoveAboveBlocks[Player:GetName()] = 0 for Y = y, World:GetHeight( X, Z ) do World:SetBlock( X, Y, Z, 0, 0 ) RemoveAboveBlocks[Player:GetName()] = RemoveAboveBlocks[Player:GetName()] + 1 end Player:SendMessage( cChatColor.LightPurple .. RemoveAboveBlocks[Player:GetName()] .. " block(s) have been removed." ) return true end