|
| 05 Mar 2017 07:03 PM |
Error:
20:01:54.986 - Unable to cast double to Vector3
SCRIPT:
Button = script.Parent Item = script.Parent.Item PlayerMouse = game.Players.LocalPlayer:getMouse() local Store = script.Parent.Parent.Parent local Button2 = script.Parent.Parent.Parent.Parent.Frame BasePlate = game.Workspace.BasePlate Moved = Item.MovedValue.Value local Nil = game.Workspace:FindFirstChild("RustyDropper")
function onClick() Moved = false Clone = Item:clone() Clone.Name = "RustyDropper" Clone.Parent = game.Workspace ItemParts = game.Workspace.RustyDropper.Model:GetChildren() Store.Visible = false Button2.Visible = true ItemParts.CanCollide = false ItemParts.Transparency = .8 end PlayerMouse.Move:connect(function() local PlayerMousePositions = PlayerMouse.Target.Position.y PlayerMousePositions = 2 if PlayerMouse.Target.Name == "BasePlate" then if Moved == false then local PlayerMousePosition = PlayerMouse.Hit.x local PlayerMousePositionss = PlayerMouse.Hit.z local PlayerMousePositions = math.ceil(PlayerMousePosition) local PlayerMousePositionss = math.ceil(PlayerMousePositions) local PlayerMousePositionsss = math.ceil(PlayerMousePositionss) Clone:MoveTo(PlayerMousePositions , PlayerMousePositionss , PlayerMousePositionsss) end end end) PlayerMouse.Button1Down:connect(function() ItemParts.CanCollide = true Moved = true end)
Button.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2017 07:07 PM |
| Make your variables local to start. Does it tell you what line the error is? |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Mar 2017 06:37 AM |
The line is 33
or
Clone:MoveTo(PlayerMousePositions, PlayerMousePositionss, PlayerMousePositionsss) |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2017 10:37 AM |
| i think its because your trying to position a vector 2 with 3 dimensions. get rid of the PlayerMousePositionsss |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2017 04:46 PM |
It has the same error if I do that. Do you know a way to combine the values so I make it 1 variable. I already tried - Local MouseAllPositions = ("PlayerMousePositions ," .. "PlayerMousePositionss ," .. "PlayerMousePositionsss") But that just takes the words and combines them so how would I make it read them as a variable? |
|
|
| Report Abuse |
|
|
|
| 06 Mar 2017 06:41 PM |
| Clone:MoveTo(Vector3.new(PlayerMousePositions, PlayerMousePositionss, PlayerMousePositionsss)) |
|
|
| Report Abuse |
|
|