|
| 01 May 2014 02:28 PM |
Ive tried everything to have a part position itself at the mouse's position, but it never works. There are no errors, everything works fine except that the Cylinder appears at (0,0,0). Heres the script,
plyr = game.Players.LocalPlayer --repeat wait() until plyr mouse = plyr:GetMouse() preCyl = script.Cylinder
function WheelF() if preCyl.BrickColor.Number == 1020 then --green preCyl.BrickColor = BrickColor.new("Really red") elseif preCyl.BrickColor.Number == 1004 then --red preCyl.BrickColor = BrickColor.new("Really blue") elseif preCyl.BrickColor.Number == 1010 then --blue preCyl.BrickColor = BrickColor.new("Lime green") end end function WheelB() if preCyl.BrickColor.Number == 1020 then --green preCyl.BrickColor = BrickColor.new("Really blue") elseif preCyl.BrickColor.Number == 1004 then --red preCyl.BrickColor = BrickColor.new("Lime green") elseif preCyl.BrickColor.Number == 1010 then --blue preCyl.BrickColor = BrickColor.new("Really red") end end --mouse.WheelForward:connect() --mouse.WheelBackward:connect() function greenCyl() if mouse.Target ~= nil then Cyl = Instance.new("Part",game.Workspace) mesh = Instance.new("CylinderMesh",Cyl) Cyl.Size = preCyl.Size Cyl.BrickColor = preCyl.BrickColor Cyl.Anchored = true Cyl.CanCollide = false Cyl.Position = Vector3.new(mouse.Hit) --Here Cyl.FormFactor = "Custom" wait() Cyl:Destroy() end end
mouse.Move:connect(greenCyl) mouse.Idle:connect(greenCyl) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 01 May 2014 02:38 PM |
Try:
Cyl.Position = mouse.Hit.p |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 May 2014 02:40 PM |
| No, problem, that's how you would obtain a part's Vector3 equivalent of a CFRame. Vector3.new(CFrame) would not error, but would return 0,0,0. |
|
|
| Report Abuse |
|
|