function MouseLockController.OnMouseLockToggled(H)H.isMouseLocked=not H.isMouseLocked if H.isMouseLocked then local y=script:FindFirstChild("\067\117\114\115\111\114\073\109\097\103\101")if y and(y:IsA("\083\116\114\105\110\103\086\097\108\117\101")and y.Value)then H.savedMouseCursor=Mouse.Icon Mouse.Icon=y.Value else if y then y:Destroy()end y=Instance.new("\083\116\114\105\110\103\086\097\108\117\101")y.Name="\067\117\114\115\111\114\073\109\097\103\101"y.Value=DEFAULT_MOUSE_LOCK_CURSOR y.Parent=script H.savedMouseCursor=Mouse.Icon Mouse.Icon=DEFAULT_MOUSE_LOCK_CURSOR end else if H.savedMouseCursor then Mouse.Icon=H.savedMouseCursor H.savedMouseCursor=nil end end H.mouseLockToggledEvent:Fire()end
--
function MouseLockController:OnMouseLockToggled()
	self.isMouseLocked = not self.isMouseLocked
	
	if self.isMouseLocked then
		local cursorImageValueObj = script:FindFirstChild("CursorImage")
		if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = cursorImageValueObj.Value
		else
			if cursorImageValueObj then
				cursorImageValueObj:Destroy()
			end
			cursorImageValueObj = Instance.new("StringValue")
			cursorImageValueObj.Name = "CursorImage"
			cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR
			cursorImageValueObj.Parent = script
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = DEFAULT_MOUSE_LOCK_CURSOR
		end
	else
		if self.savedMouseCursor then
			Mouse.Icon = self.savedMouseCursor
			self.savedMouseCursor = nil
		end
	end
	
	self.mouseLockToggledEvent:Fire()
end
