Hi! I am getting a weird bug where the positions of my block are weird.
So I have this script:
repeat wait() until workspace.Map
for index, block in ipairs(workspace.Map:GetChildren()) do
local blockPos = block.Position
block.Name = blockPos.X .. " " .. blockPos.Y .. " " .. blockPos.Z
end
When I run it I get weird names for the block even though the position is a whole number.
If you print the position of a part you will get a long number with like 10 digits. I would turn that number in to a string than compress it to the first 3-4 digits than make it the parts name.
You can always split based off of the length or splitting the string by the “.”
Example: 1000.599e9
Split the string at the “.”, you’ll be left with 1000 and the rest of the digit, perform your string.sub on the second tidbit (if necessary) and then concatenate it back. You can get the length of the string (ex if less than 5 in string length then don’t do anything on the particular X Y or Z value). This is a little bit of a lengthier process and I had not initially thought of it but the above should work if no other better scenario is given.