I have no errors in this script. And it works fine, except the "Wood" doesn't go to the mouses target. Script:
player = game.Players.LocalPlayer mouse = player:GetMouse() script.Parent.Selected:connect(function(build) l = Instance.new("Part", workspace) l.Name = "Wood" l.TopSurface = "Smooth" l.BottomSurface = "Smooth" l.Anchored = true l.Transparency = 0.4 l.BrickColor = BrickColor.new("Brown") l.CFrame = CFrame.new(Vector3.new(l.Position, mouse.Target)) end)
Line 11 change to:
l.CFrame = CFrame.new(mouse.Hit.p)
Mouse.Target returns an object and you want to put the wood where the mouse is in the 3d space. Mouse.Hit returns the CoordinateFrame of the mouse so using mouse.Hit.p 'p' getting the position at which the mouse is at will fix your problem.