03-14-2013, 05:48 AM
i need a way that do something for each block in a certain area around a player. i now have this code:
local X = math.floor(Player:GetPosX()) local Y = math.floor(Player:GetPosY()) - 1 local Z = math.floor(Player:GetPosZ()) local XX = math.floor(Player:GetPosX()) local YY = math.floor(Player:GetPosY()) - 1 local ZZ = math.floor(Player:GetPosZ()) local World = Player:GetWorld() local Radius = tonumber(Split[3]) while Z ~= ZZ - Radius do Z = Z - 1 while Y ~= YY - Radius do Y = Y - 1 while X ~= XX - Radius do X = X - 1 Execute( X, Y, Z, Player, Split, Target, World ) --is the function that does something for a block. end end endbut it doesn't realy work for me. It also has to work when the player is in negative coordinates.