so Im trying to lerp a block to my current mouse position but I receive the error Attempt to connect failed: Passed value is not a function at the if m.Move:connect() then.
spawn(function() local m = game.Players.LocalPlayer:GetMouse() if m.Move:Connect() then for i = 1, #SoundBlok do if i == 1 then SoundBlok[i].CFrame = SoundBlok[i].CFrame:lerp(m.Hit, 0.1) end end for i = 1, #SoundBlok2 do if i == 1 then SoundBlok2[i].CFrame = SoundBlok2[i].CFrame:lerp(m.Hit, 0.1) end end end end) end)
This works but the errors slowly cause your game to lag out and eventually freeze
How would I go about fixing this? I've tried many things
spawn(function() local m = game.Players.LocalPlayer:GetMouse() m.Move:connect(function() for i = 1, #SoundBlok do if i == 1 then SoundBlok[i].CFrame = SoundBlok[i].CFrame:lerp(m.Hit, 0.1) end end for i = 1, #SoundBlok2 do if i == 1 then SoundBlok2[i].CFrame = SoundBlok2[i].CFrame:lerp(m.Hit, 0.1) end end end end) end)
Try this it may not be 100% right cus i wrote it in da browser