So why is this script making so the part is resizing on both sides on the part when you do the X and Z axis, I tried to make the wall resize like welcome to bloxburg but it just resizes on the both ends of the part. I want it to resize only on the Z axis if you are resizing on the Z axis but only one side of the part that you are trying to resize and let it stay in the same position it is in but resize it.
Here is the local script:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local part = workspace.laser local sizing = false while mouse.Button1Down do sizing = true local x,y,z = mouse.hit.x, mouse.hit.y, mouse.hit.z part.Size = Vector3.new(math.floor(x), 1, math.floor(z)) wait() end mouse.Button1Up:connect(function() sizing = false end) spawn(function() print(sizing) while not sizing do local x,y,z = mouse.hit.x, mouse.hit.y, mouse.hit.z part.Position = Vector3.new(math.floor(x),math.floor(y),math.floor(z)) wait() end end)
You can change the part's CFrame to an offset of half the mouse's hit.
For example, if the part's size increases by 2.6 studs on its Z axis, it will go to the right by 1.3 studs. Therefore it won't resize on both sides.
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local part = workspace.laser local OriginalPosition = part.CFrame --This sets the part's original position so we can set the offset later. local sizing = false while mouse.Button1Down do sizing = true local x,y,z = mouse.hit.x, mouse.hit.y, mouse.hit.z part.Size = Vector3.new(math.floor(x), 1, math.floor(z)) part.CFrame = OriginalPosition + Vector3.new(math.floor(x)/2, 0, math.floor(z)/2) wait() end mouse.Button1Up:connect(function() sizing = false end) spawn(function() print(sizing) while not sizing do local x,y,z = mouse.hit.x, mouse.hit.y, mouse.hit.z part.Position = Vector3.new(math.floor(x),math.floor(y),math.floor(z)) part.CFrame = OriginalPosition + Vector3.new(math.floor(x)/2, 0, math.floor(z)/2) wait() end end)
~SkeletalReality