Variable problem I don't understand

Hello, I am having a problem where I keep getting an error for this variable:

local Mouse = Player:GetMouse()

image

If someone knows what this means please tell me how to fix it.

Most of code:

local Part = script.Parent
local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

while true do
	wait(0.1)
---A lot of other code for a BodyGyro
end

50% Asked
Is this on a Server Script…?

2 Likes

LocalPlayer is only accessible inside a local script.

You should put your code into a local script inside the starterPlayerScripts folder in players.

3 Likes

Lol I just realized it wasn’t, thanks for the reminder.