What i'm doing
I'm trying to make an object in starter pack slowly move to the position of mouse when you click. I'm given the error ; 'for' initial value must be a number as an error. I don't understand.
--// "Variables" \\--
tool = script.Parent
handle = script.Parent.Handle
CPart = game.Workspace.CPart
local player = game.Players.LocalPlayer
PMouse = player:GetMouse()
m = handle.Position
m1 = PMouse.X
m2 = PMouse.Y
--// Tables \\--
--// Functions \\--
tool.Equipped:Connect(function(Jan)
PMouse.Button1Down:Connect(function()
for i = m, m1, 1 do
handle.Position = Vector3.new(i,i,i)
wait()
end
end)
end)
tool.Equipped:Connect(function(Feb)
PMouse.Button1Down:Connect(function()
for i = m, m2, 1 do
handle.Position = Vector3.new(i,i,i)
wait()
end
end)
end)

6 comments
how to lua format the whole thing it only does 1 line!??!!
The error basically says you didn't give numbers. you gave it Vector3s.
Also press Ctrl + Shift + K for a code block whilst in the editor.
would u answer im a little confused
handle.Position is a vector3 for loops want one number for the first value but you gave it 3 for the first value you should do somehing like for i = m.X, m2 do and the last value defaults to 1
also ur saying handle.Position = Vector3.new(handle.Position)