I'm tried ignoring the Character with both rays and the mouse so he can't place any objects on him or near him but it won't work.Your still able to place blocks on the character why?
-- 6/10/2015 By:Zobomafoo
--Purpose:Creates a movable model using rays and mouse events
--[[Setup]]--
Player = game.Players.LocalPlayer
-------------------------------
Vairables = {
Part = game.ServerStorage.Part,
Mouse = Player:GetMouse()}
-------------------------------
Functions = {
CreateRay = function(IgnorePart)
local Ray = Ray.new(Vairables.Mouse.UnitRay.Origin,Vairables.Mouse.UnitRay.Direction*900)--Create ray from mouse and reaches 900 studs max
local Hit,Pos = game.Workspace:FindPartOnRay(Ray,IgnorePart)--Ray,PartIgnoredByRay
return Hit
end}
-------------------------------
ClonedPart = Vairables.Part:Clone()
ClonedPart.Parent = game.Workspace
--~~--~~[[Everything starts here]]~~--~~---
Vairables.Mouse.TargetFilter = ClonedPart
Vairables.Mouse.Move:connect(function()
local Hit = Functions.CreateRay(Player.Character)
if Hit then -- if hit then do the following
ClonedPart:MoveTo(Vairables.Mouse.Hit.p)
end
end)
-----------------------------------------
Vairables.Mouse.Button1Down:connect(function()
local NewPart = ClonedPart:Clone()
NewPart.Parent = game.Workspace
end)
Edit:
Unable to cast Vector3 to CoordinateFrame
Script 'Players.Player.PlayerGui.LocalScript', Line 27
-- 6/10/2015 By:Zobomafoo
--Purpose:Creates a movable model using rays and mouse events
--[[Setup]]--
Player = game.Players.LocalPlayer
-------------------------------
Vairables = {
Part = game.ServerStorage.Part,
Mouse = Player:GetMouse()}
-------------------------------
ClonedPart = Vairables.Part:Clone()
ClonedPart.Parent = game.Workspace
-------------------------------
IgnoreTable = {Player.Character,ClonedPart}
-------------------------------
Functions = {
CreateRay = function()
local Ray = Ray.new(Vairables.Mouse.UnitRay.Origin,Vairables.Mouse.UnitRay.Direction*900)--Create ray from mouse and reaches 900 studs max
local Hit,Pos = game.workspace:FindPartOnRayWithIgnoreList(Ray,IgnoreTable)
return Hit,Pos
end}
--~~--~~[[Everything starts here]]~~--~~---
Vairables.Mouse.Move:connect(function()
local Hit,Pos = Functions.CreateRay()
if Hit then -- if hit then do the following
ClonedPart:SetPrimaryPartCFrame(Pos)
end
end)
-----------------------------------------
Vairables.Mouse.Button1Down:connect(function()
local NewPart = ClonedPart:Clone()
NewPart.Parent = game.Workspace
end)
Why won't it work and how do I fix it?

2 comments
I edited my answer again
You have to use CFrame.new() for a coordinate frame, not Vector3.new(). CFrame.new(X, Y, Z)