function setPosition(mousePos,part,target,surface) --Snapping the parts
if(target == nil) then
return mousePos + Vector3.new(0,part.Size.Y/2,0)
elseif(target.Parent.Name == "BuildPartModel") then
return mousePos + Vector3.new(0,part.Size.Y/2,0)
elseif(surface == "Right" or surface == "Left") then
local targetPosX = target.Position.X
local targetSize = target.Size
local targetEdgePos
if(mousePos.X >= targetPosX) then
targetEdgePos = targetPosX + targetSize.X/2 + part.Size.X/2
return Vector3.new(targetEdgePos,target.Position.Y,target.Position.Z)
else
targetEdgePos = targetPosX - targetSize.X/2 - part.Size.X/2
return Vector3.new(targetEdgePos,target.Position.Y,target.Position.Z)
end
elseif(surface == "Back" or surface == "Front") then
local targetPosZ = target.Position.Z
local targetSize = target.Size
local targetEdgePos
if(mousePos.Z >= targetPosZ) then
targetEdgePos = targetPosZ + targetSize.Z/2 + part.Size.Z/2
return Vector3.new(target.position.X,target.Position.Y,targetEdgePos)
else
targetEdgePos = targetPosZ - targetSize.Z/2 - part.Size.Z/2
return Vector3.new(target.position.X,target.Position.Y,targetEdgePos)
end
elseif(surface == "Top" or surface == "Bottom") then
return Vector3.new(target.Position.X,target.Position.Y + target.Size.Y/2 + part.Size.Y/2,target.Position.Z)
end
end
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}