Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

PlayerScripts.Camera:13: attempt to index function with 'Connect'?

local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera:GetPropertyChangedSignal("CameraType"):Connect(function()
    Camera.CameraType = Enum.CameraType.Scriptable
end)
local Mouse = game.Players.LocalPlayer
local LastY = 0
local LastX = 0
local DefaultCFrame = workspace.Part.CFrame


game:GetService("RunService").RenderStepped:Connect(function()--Up Barrier
	Mouse.Move:Connect(function()	
	if Mouse.Y <= 21 then
	if Mouse.Y - LastY <= -1 then 	
	local MoveVector = Vector3.new(0,-(Mouse.Y*1)/7, 0)
	Camera.CFrame = DefaultCFrame * CFrame.new(DefaultCFrame.p + MoveVector)
	DefaultCFrame = CFrame.new(DefaultCFrame.p + MoveVector)
    LastY = Mouse.Y					 
	else LastY = Mouse.Y
		   end
		end
	end)	
end)

2 answers

✓ Accepted answer

The variable for Mouse is the LocalPlayer. Instead change it to local Player = game.Players.LocalPlayer and local Mouse = Player:GetMouse()

2 comments

1

LMAO HOW DID I MISS THAT THANK YOU THO

0

np :)

The variable Mouse is the LocalPlayer, not the mouse.

local Mouse = game.Players.LocalPlayer

should be:

local Mouse = game.Players.LocalPlayer:GetMouse()

nvm answered while i was typing :(

This discussion is preserved as it was. New answers, comments, and votes are closed.